| | |
the innerHTML of page
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 10
Reputation:
Solved Threads: 1
I'm trying to get some HTML code from a page. The only way to do this that I know of is
But the problem is that the page is taken from the web and it has no IDs to get and I can't modify it by putting IDs.
So is there a way to get the innerHTML of the whole page so I can search for certain strings afterwards?
javascript Syntax (Toggle Plain Text)
document.getElementById('id').innerHTML = 'newhtml';
So is there a way to get the innerHTML of the whole page so I can search for certain strings afterwards?
•
•
Join Date: Jan 2006
Posts: 14
Reputation:
Solved Threads: 1
Hi, SirDorius.
Instead of using You could use
This method will give you an array of all the elements on the page with that tag name. Just access each tag like you would access an array.
For example, if you wanted to get the inner HTML of the third division on the page you could use:
Hope that helps,
Adam
Instead of using
javascript Syntax (Toggle Plain Text)
document.getElementById(id).innerHTML;
javascript Syntax (Toggle Plain Text)
document.getElementsByTagName(tag)[0].innerHTML;
This method will give you an array of all the elements on the page with that tag name. Just access each tag like you would access an array.
For example, if you wanted to get the inner HTML of the third division on the page you could use:
javascript Syntax (Toggle Plain Text)
document.getElementsByTagName("div")[2].innerHTML;
Hope that helps,
Adam
![]() |
Similar Threads
- How to get the link that was clicked even after the page gets refreshed (JSP)
- Custom page to login to Yahoo, Gmail, MSN etc (JavaScript / DHTML / AJAX)
- Dual use of <asp:TextBox in ASP.NET page (JavaScript / DHTML / AJAX)
- Javascript causes page to crash (JavaScript / DHTML / AJAX)
- This ASP.NET page is not working...!!! SOS (ASP.NET)
- How to get the link that was clicked even after the page gets refreshed (JavaScript / DHTML / AJAX)
- update the page without changing it? (Site Layout and Usability)
- Retrieving values from pop up and displaying into asp page (ASP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: timescript- page redirection
- Next Thread: how to run javascript program
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
acid2 ajax ajaxexample ajaxjspservlets array blackjack browser captcha captchaformproblem cart child class close codes date debugger dependent developer disablefirebug dom editor element embed engine enter events explorer ext file firefox flash focus form forms frameworks game getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe java javascript javascripthelp2020 javascripts jquery jsf jsp jump libcurl listbox maps marquee masterpage math media menu object onerror onmouseoutdivproblem onmouseover onreadystatechange parent passing paypal pdf php position post programming prototype rated redirect safari scale scriptlets scroll search security size software sources star starrating stars stretch synchronous toggle tweet unicode variables web webservice window \n





