469,640 Members | 1,561 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,640 developers. It's quick & easy.

Getting document's entire HTML

moishy
104 100+
I want to get the page's source code.
The best I came up with was: document.getElementsByTagName('html')[0]
Is there something shorter than that?
Dec 6 '07 #1
1 938
acoder
16,027 Expert Mod 8TB
If you give the HTML tag an id, then you can use document.getElementById(id). Not much shorter, but there you go.
Dec 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Michael Hill | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.