javascript - Error Unexpected Token ILLEGAL with read from img attribute -
i try read src
of image here :-
<div class="featured_preview"> <img src="ggat/wp-content/uploads/2015/03/11-192x236.jpg" width="300"> </div>
by code :-
jquery(document).ready(function() { jquery(".open-popup-link").click(function () { alert(jquery(".featured_preview img").attr("src");); }); });
why show me error :-
uncaught syntaxerror: unexpected token illegal
change this:
alert(jquery(".featured_preview img").attr("src");); // note semi colon
by:
alert(jquery(".featured_preview img").attr("src"));
Comments
Post a Comment