Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inline hiding

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
how do I hide an image without using a style sheet?

<script>
imageName.visibility: hidden;
</script>
 
take a look at this example and see what you can do with it in your code:

<html>
<head>

<script language=&quot;javascript&quot;>

function HideUnhide()
{
div1 = document.getElementById('one');
div2 = document.getElementById('two');

if (div1.style.visibility == 'hidden')
{
div1.style.visibility = 'visible';
div2.style.visibility = 'hidden';
}
else
{
div1.style.visibility = 'hidden';
div2.style.visibility = 'visible';
}
}
</script>

</head>
<body>


<div id=&quot;one&quot; style=&quot;visibility:hidden;&quot;><img name=&quot;img1&quot; src=&quot;rt_trans.gif&quot; width=10 height=10>I'm visible for now (div1)</div>
<div id=&quot;two&quot; style=&quot;visibility:visible;&quot;><img name=&quot;img1&quot; src=&quot;rt_trans.gif&quot; width=10 height=10>I'm visible for now (div2)</div>

<a href=&quot;#gonowhere&quot; onclick=&quot;HideUnhide()&quot;>Click me! :)</a>

</body>
</html>

Hope this helps,
Erik <-- My sport: Boomerang throwing !!
!! Many Happy Returns !! -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top