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
Post a Comment