JSFiddle - React, Tailwind, and code Playground

by calder12

HTML

<div id="pastedimages" style="display:block">
<form id="finalsave" action="" method="post" enctype="multipart/form-data" onSubmit="return validateForm()"></form> 
  <span>
    <img width="100" height="80" src="http://localhost/images/515aadc459823.png">
    <label>    </label>
        <input id="515aadc459823" type="checkbox" name="slct[]" value="http://localhost/images/515aadc459823.png" checked="checked">
        <a title="515aadc459823.png" href="http://localhost/images/515aadc459823.png" target="_blank">image 1</a>

    <input id="515aadc459823" type="text" name="515aadc459823"><br>
  </span>
</form>
</div>
        <a href="" id="click">click</a>

JavaScript

$("#click").on("click",function(){
    var comments = '';
jQuery('#pastedimages input[type=text]').each(function (){
            comments +=jQuery(this).val() + "$" +jQuery(this).attr('id')+":";
            });
    alert(comments);
    return false;
});