I am trying to get plain text out of value stored in variable like this
var lb = $(this).attr("htmllabel");
var text = $(this).html(lb);
alert(text);
When the alert popup it give result as object[Object] but I was expecting the actual string after application of the function.
Can anyone help me in this? Thanks.
$(this).html(lb)This line is setting the html of whatever
thisis to whatever is stored inlb. It then returns the jquery object for chaining purposes.If you want the
htmlofthisthen you just call$(this).html()with no parameter.