javascript - Use same image for link for each row of a table -
I found a link on each line in a table I am trying to add the same image to link The image is only added to the first line and not for the other rows. This is what I have to do.
$ (document) .ready (function () {$ ('. Is selected'). Click (function () {var pdtname = $ (this) ARTR ('Data-product name '' ($ (This) .prop ("check") {$ ("# result"). Show (); if ($ (". Is selected: checked"). Length = PRO (" Disabled ", true);} var table = $ ('& lt; table & gt; & lt; table & gt;') AddClass (" .tar "(" data-product name ", PDTNA); var line = $ ('& Lt; tr & gt; & lt; / tr & gt;') AddClass ('rfoo'). Text (PDTNA); ** var link = $ ("#ImgLogo"). Wrap ('& lt ; A href = "javascript: zero (0);" & gt; & lt; / a & gt; '). AddClass (' lfoo '); * * Line .append (link (click on 'click', function) ($ {'input [data-productname]; $' ('# result'). = "'+ $ (This) .Parent () .Parent ) .Parent () Attr ("data-productname") + '"]'). Prop (" checked ", false); $ (This) .parent () parent () to parent () Delete () .. $ ("IsSelected.") Support (": check") Sahara ("disabled", false);}});} and {$ ('table [data-product name =' '+ pdtname + ']'). Remove (); $ ("IsSelected.") No (": Check") Sahara ("Disabled", false); .. }}); });
This is the line of the image link var link = $ ("# imgLogo"). Rap ('& lt; a href = "javascript: zero (0);" & gt; & lt; / a & gt;'). AddClass ('lfoo');
"post-text" itemprop = "text">
It looks like you want something like this:
To improve it There are better ways, but this is for another question. What you're worried about, you want to clone the image and use id
instead of class
.
Change:
- link generating JS
- img html
- Features and attribute-value li>
Comments
Post a Comment