DOM - Move element?

Discussion in 'JavaScript' started by Triexa, Dec 20, 2006.

  1. #1
    I am creating a web app and I want to be able to move an object to another spot.

    Right now what I have done is copy the html of the old one, insert it to the end of the node I want, then delete the old one.

    As a result, I lose events/observers that have been applied (i.e. for double clicking, dragging, etc.)

    Edit: I also have <input> boxes in the element I wanna copy, so if I just get the HTML I lose their values too. If there is some way to copy the whole object, with the "correct" values, applied events, etc.. that would be WONDERFUL!
     
    Triexa, Dec 20, 2006 IP
  2. Triexa

    Triexa Active Member

    Messages:
    580
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    I got the solution on another forum... using removeChild returns the object... so I can just use that and insert it elsewhere
     
    Triexa, Dec 20, 2006 IP