Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use InnerHTML

Status
Not open for further replies.

aspjunior

Programmer
Feb 6, 2003
3
0
0
GB
How do I grab all my stuff between two div tags using innerhtml?
 
You can use getElementById, if the DIV has an ID... For example:

Code:
document.getElementById('myDiv').innerHTML = '<b>Hello World!</b>';

and

Code:
var myHTML = document.getElementById('myDiv').innerHTML;

would work if there was a DIV with the ID of "myDiv" on the page:

Code:
<div id="myDiv"></div>

Hope this helps,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top