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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -