jquery - How to display image in div with its source -


i getting image source li element.

$(document).ready(function () {     $('li.k-state-selected').live("click", function () {         var src = $(this).find("img").attr("src");         alert(src);     }); }); 

so how can display image in div using source?

$(document).ready(function () {     $('li.k-state-selected').live("click", function () {         var src = $(this).find("img").attr("src");         $("#youotherdiv").append("<img src='"+ src + "' />");     }); }); 

just add new line ;) this


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -