Jquery - adding image to multiple spans inside a table, dynamically created using Java -


i'm creating table in java class (in controltableinitial() method):

res.add("<tr>"+"<td>"+result.getstring("product_barcode")+"</td>" +"<td>"+showed+"</td>" +"<td>"+result.getstring("product_price")+"</td>" +"<td>"+result.getstring("submit_user_email")+"</td>" +"<td>"+result.getstring("sales_date")+"</td>" +"<td id='setsale'><span id='img'></span></td>" +"</tr>"+"<br/>"); 

than, build table in .jsp file:

<%       arraylist<string> res = new arraylist<string>();     controlpanel tbl = new controlpanel();     res = tbl.controltableinitial();  %> <table id="table">               <%             for(int i=0;i<res.size();i++) {out.println(res.get(i));}         %>     </table> 

and finally, add image span id "img" using jquery:

$(document).ready(function() {     $("#img").append('<img class="image" src="img/v.jpg"/>'); }); 

the problem can see image in 1st row, not in others. also, using css, change cursor type when hovering on inserted image. , can see cursor type changes in rows images should (but, said, can see iserted image in 1st row.).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -