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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clicking a button makes div invisible. 1

Status
Not open for further replies.

MJB3K

Programmer
Jul 16, 2004
524
GB
Hi, i was wondering how you can do this:

If you click a form button, it makes a div invisible.
Also the div should b about 60% visibility then when the button is clicked, it makes it invisible or 0%.

Any ideas??



Regards,

Martin

Computing Help And Info:
 
Aaah what the heck - there's more HTML and CSS involved that JavaScript:

Code:
<html>
<head>
	<style type="text/css">
		div#myDiv {
			background-color: red;
			-moz-opacity: 0.6;
			-khtml-opacity: 0.6;
			opacity: 0.6;
			filter: alpha(opacity=60);
			_zoom: 1;	/* Needed for IE to give the element "layout" */
		}

	</style>
</head>
<body>
	<input type="button" onclick="document.getElementById('myDiv').style.display = 'none';" value="Hide Div" />
	<div id="myDiv">
		This is a div
	</div>
</body>
</html>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top