If I have: <span>Some Code Here</span>, can I create a new div element and move the span element inside just created div?
The new element must be in same place where span element was before
I’d like to use pure javascript code
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.
What this does is create a new
<div>, creates copy of thespan, removes the originalspanand then inserts the copy inside thedivjsFiddle
this is the same example within a container