Say for example I have a body with the class “test” and I want to take that class and add it to another div, how can I do this with jQuery?
Thanks
Edit: Something like this?
$("body.test").clone().attr("class").prependTo("div");
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.
should do it – syntactically untested, but it’s roughly what I’d do.