General discussion

Locked

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.

3 total posts (Page 1 of 1)  
| 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 
</span>

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 -

CSS

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

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums