Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery IE7 Id append issue

Tags:

jquery

css

So I have following Jquery

    $j("a#Pinterest").html("<img src='/images/Social Media/pinterest.png'>");

And mark up is as follows ;

<a id="Pinterest"></a>

Which works fine, but the user has an option to add multiple to one page, and I noticed that in IE7 only the first anchor gets the image attached and not the others. In all other browsers, they all get the image attached.

Any Ideas ?

like image 859
StevieB Avatar asked Nov 20 '25 03:11

StevieB


1 Answers

id must be unique on a html page. You can only use the same ID once. Use a class attribute instead.

like image 98
Fabian Barney Avatar answered Nov 21 '25 18:11

Fabian Barney



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!