Solved

Javascript - insertAdjacentHTML Problem

Posted on 2007-03-18
1
183 Views
Last Modified: 2008-02-20
How do I get it to not finish the tags?

For instance I am trying to insert a form around some content but when I add the form attribute it closes it right after...

0
Comment
Question by:B_Dorsey
1 Comment
 
LVL 9

Accepted Solution

by:
pallosp earned 500 total points
ID: 18743497
You can only do it in two steps:

1. Create a <form> element and insert it somewhere into the document
    (http://developer.mozilla.org/en/docs/DOM:document.createElement)
2. Iterate over the content and insert it inside the <form> tag
    (http://developer.mozilla.org/en/docs/DOM:element.appendChild)
    The appendChild() method removes the node from its previous place.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question