views:

99

answers:

2

Been trying to add an image before the closing of the anchor tag:

<body>
    <a href="http://www.test.com/"&gt;http://www.test.com/&lt;/a&gt;
</body>

If I use:

$("a").append("<img src='testimage.png' /");

No image will appear in WebKit (Chrome, Safari, etc). Firefox and IE works fine. What am I doing wrong? Thanks in advance

+1  A: 

Try with proper xml:

$("a").append("<img src='testimage.png' />");
#                                        ^-- there  
Kobi
thanks for the spot. I should know now that WebKit doesn't auto correct a lot of the small mistakes like IE and FF does
Alex
+1  A: 

Haven't tested if this solves your issue, but including a closing gt for your img might help:

$("a").append("<img src='testimage.png' />");
Jason Leveille