| | |
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 ajaxcode ajaxhelp animate api automatically beta box browser bug calendar captchaformproblem checkbox child class column cookies createrange() css cursor decimal dependent design disablefirebug dom download dropdown editor element engine error events explorer ext file firehose form forms google gwt html htmlform ie8 iframe image() images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jump listbox math matrixcaptcha microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent pdf php player post problem progressbar rated rating regex runtime scroll search select session shopping size sql star starrating stars text textarea twitter validation w3c web website window windowofwords windowsxp wysiwyg xml \n





