Solved

Javascript - insertAdjacentHTML Problem

Posted on 2007-03-18
1
179 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now