Solved

Javascript - insertAdjacentHTML Problem

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

757 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

21 Experts available now in Live!

Get 1:1 Help Now