I have copied the html contents of a div to a variable in javascript. Now i want to put the value of title attribute to the content of the TD tags whichever has the class as popup. So i created the following code. But it didn’t help..
var tmpDiv = document.createElement("div");
tmpDiv.setAttribute("style","display:none");
$(tmpDiv).html($('#'+divid+" .scrollTableContainer").html());
$(tmpDiv+ 'td .popup').each(function(index,value) {
$(this).html($(this).attr('title'));
});
In your code tempDiv is javascript object so tempDiv+’td.popup’ is not allowed.
Secondly if you need to find td with class popup remove space between td and .popup