Let’s suppose I have some element and also have some picture in folder. So what I want to do is to take exactly this div and covert it into img tag using picture that I have as a source.
Share
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.
From the jQuery docs:
So really, instead of “converting” the
divas you ask in your question, this removes thedivand replaces it with a newimgelement. Which should work exactly as you expected, but it’s difficult to say for sure without a clearer question.Here’s an example fiddle to get you started.