JavaScript can access hidden HTML Jul27 '06
Something interesting, but probably absolutely useless, but I’d thought I’d share, anyway...
<!-- <p id="para"></p> -->
See how this is hidden from the browser, with HTML comment tags?
However, JavaScript can still access this paragraph, even though it’s hidden from view:
var para = document.getElementById("para");
I don’t know what purpose this serves, but I noticed it, so I’d thought I’d share.
Carry on.
Categories: HTML
, JavaScript ![]()
Add Feedback (view all)
Leave feedback
Yes, but hidden form fields are different - Matt’s talking about commented out HTML! I find that very strange that Javascript can "see" that ... Read more.
Just came across this and I can think of one pretty good reason javascript could see commented code. If you write a help system using javascript t ... Read more.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- JavaScript: billing/shipping address copy (141 recent visits)
- JavaScript string replace for post slug (1069 recent visits)
- JavaScript set selected on load (7433 recent visits)
- JavaScript open links in new window (1328 recent visits)
- JavaScript dynamic DOM retrieval (404 recent visits)
- JavaScript function to the rescue! (26 recent visits)
Stats
394 unique visits since August 2008
Recent Referrers (click)
- accessing hidden variable
- html hidden javascript
- http://10.236.176.126:15871/cg
- javascript get html comments
- javascript access hidden field value
- accessing a hidden variable in the javascript
- access hidden field javascript
- hidden HTML form fields in Javascript
- JavaScript accesshidden field form
- how access hidden field from javascrip
- how to access hidden php javascript
- how to access hidden html elements value in javascript
- http://google.com/
- hidden html
- <html:hidden> in javascript
- html:hidden javascript
- how to access hidden variables in javascript
- javascript access hidden input
- add <html:hidden in a javascript function
- javascript write hidden fields on web
Actually in the product I work on, we use hidden form fields all over the place to pass data between UI stuff when it is not worth sending back to ... Read more.