javascript - How to move HTML element -


How to take HTML element into another element I note, I do not mean that the element is increasing Consider this HTML code:

  & lt; Div id = "target" & gt; & Lt; / Div & gt; & Lt; Span id = "to_be_moved" & gt; & Lt; / Span & gt;  

I want to move "to_be_moved" to "target" so that the "target" child can be "to_be_moved". Then the result should be like this:

  & lt; Div id = "target" & gt; & Lt; Span id = "to_be_moved" & gt; & Lt; / Span & gt; & Lt; / Div & gt;  

I searched in Google (especially the prototype framework), but the situation of everyone is growing as much as I want. First Thanks

  document. GetElementById ('target'). AppendChild (document.getElementById ('To_be_moved'))  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -