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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -