avi avi - 1 month ago 6
Javascript Question

Uncaught SyntaxError: Unexpected token in Javascript

I am trying to insert hyperlink to my survey i am getting this error in this line var myspan1 = $(“span[title=’Laptop’]”);

Answer

Use single and double quotes properly. Try this

$(document).ready( function() {
    var myspan1 = $("span[title='Laptop']");
    myspan1.append("<a target='_blank' style='vertical-align:middle;color:#0072c6'  href='@http://doc/IT/IT%20Library/SP_UAT%20Server%20and%20Services%20Error.PNG'> <b>[Show]</b></a>");
});