Web Development

General discussion


Hidding in HTML

By Karthikeyan Umapathy ·
Is there a way to hide something using HTML or other means in a webpage.

I want to put free web tracking in my page and same time hide it. Is this possible.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

JavaScript and innerHTML

by Ed Woychowsky In reply to Hidding in HTML

contained in the span tags incase it is needed later before erasing it, which is performed by the JavaScript function hideStuff. The function show stuff copies the original HTML from the hidden text box and restores it. Hope this helps.

<input type=?hidden? name=?hdnHTML?>
<span id=?spanToHide?>
<input type=?text? name=?txtStuff?> <!?Object to hide 

function hideStuff() {
document.all.hdnHTML.value = document.all.spanToHide.innerHTML;
document.all.spanToHide.innerHTML = ??;

function showStuff() {
document.all.spanToHide.innerHTML = document.all.hdnHTML.value;

Collapse -


by Jay Eckles In reply to Hidding in HTML

Use cascading style sheets. Give the element you want to hide an id attribute, then use that id to reference the element in Javascript. Use Javascript to set the element's hidden and visible attributes. This will properly hide the element.

Collapse -

CSS is easiest

by dahlbyk In reply to Hidding in HTML

Just put style="display: none" in the containing block's tag. If this doesn't work, please post the code you need to hide. You shouldn't need Javascript to hide it.
Cheers ~ K

Related Discussions

Related Forums