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.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of 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.
Popular Pages
- Fast rounded corners in Photoshop (7875 recent visits)
- PHP – passing variables across pages (2860 recent visits)
- JavaScript set selected on load (2345 recent visits)
- Removing all child nodes from an element (1704 recent visits)
- iPod songs out of order? (1412 recent visits)
- Firefox 3 smart address bar: wildcard search (1300 recent visits)
- Britney - Everytime piano tab (1180 recent visits)
- MySQL LEFT JOIN syntax (971 recent visits)
- Breathe Me - Sia (824 recent visits)
- Tumblr: how blogging should be (727 recent visits)
Similar Entries
- JavaScript: billing/shipping address copy (29 recent visits)
- JavaScript string replace for post slug (334 recent visits)
- JavaScript set selected on load (2345 recent visits)
- JavaScript open links in new window (426 recent visits)
- JavaScript dynamic DOM retrieval (108 recent visits)
- JavaScript function to the rescue! (4 recent visits)
Stats
125 unique visits since August 2008
Recent Referrers (click)
- access html from javascript
- html hidden javascript
- javascript accessing html in javascript
- hidden hml
- accessing +hidden +javascript
- how to access html hidden field value in java script
- accessing hidden variable in javascript
- access hidden variable in javascript
- accessing hidden variable html
- Access Hidden Variables + Javascript
- how to access Html hidden control in a Javascript?
- html form hidden javascript
- html form hidden javascript
- s:hidden javascript
- html: hidden
- html form hidden javascript
- access hidden variable in javascript
- Access hidden input variables on javascript
- access hidden variable in javascript
- http://matthom.com/archive/200
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.