Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Below jquery code works fine however Img tag is not getting appended in htmlContent string.

JavaScript
$(htmlContent).find('a.someClass').append(
    '<img src="https://pmcontent.blob.core.windows.net/images/oneDocument.png" title="click to send" />');


And original htmlContent string is

XML
<div id="divContent">
<span style="font-family: ms sans serif;">
<br>
<br>
<a class="someClass" target="_blank" href="http://localhost/18054/Office/Docs/SignAgreement?primaryObjectId=835e2315-51d5-46f5-a260-236e858a7534&contactId=d1abf449-36c5-4617-8caf-6e529597eb8f&docId=1d136a29-09dc-4cea-a9e0-96b318eee919&filePath=test%252f92f70853ea5f4c2784f07ded02ab820f%252fMyDocuments%252fdigital%252bsignatured%252bdocs%252fHTML%252520Agreement%252520with%252520Signature.html%253f131022050245#_blank">click to sign</a>
</div>
Posted
Comments
Maarten Kools 27-Feb-14 3:20am    
It works fine for me: http://jsfiddle.net/F3Xza/[^]
ravikhoda 27-Feb-14 3:54am    
try and check if you get any error from console.

1 solution

HTML
$("a[class='someClass']").append(
    '<img src="https://pmcontent.blob.core.windows.net/images/oneDocument.png" title="click to send" />');


[edit]Code block added[/edit]
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900