The following code doesn’t work! ‘this’ in in the context when i access it is the document.
$(document).ready(function(){
$(".myclass[id]").html(this.id);
});
How do I do the above without writing an extension or plugin? Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You want to put an attribute value on the innerHTML each node on a set of matched elements.
I suggest you to iterate over all the matched elements, and get the attribute you desire of each one: