---
title: "Jquery show hide toggle "
author: "hsys"
date: "2010-02-01T18:41:48Z"
tags: []
categories: ["Web前端"]
slug: "jquery-show-hide-toggle"
draft: false
lastmod: "2010-02-01T18:41:48Z"
id: 585259
url: "https://hsys.iteye.com/blog/585259"
---

```html

<html>
<head>
<title>show hide toggle</title>
<script type='text/javascript' src="jquery/jquery-1.3.1.js"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		$("#show").click(function(){
			$("#showDiv").show(1000,alert(100));
		});
		$("#hide").click(function(){
			$("#showDiv").hide(1000,alert(200));
		});
		$("#toggle").click(function(){
			$("#showDiv").toggle(1000,alert(300));
		});
	});
</script>
<style>
	.showDiv
	{
		width:200px;
		height:200px;
		border:1px red solid;
	}
</style>
</head>

<body>

<div class="showDiv" style="display:none;" id="showDiv">show and hide</div>
<p style="display: none">Hello</p>

<input type="button" value="Show" id="show" />
<input type="button" value="Hide" id="hide" />
<input type="button" value="Toggle" id="toggle" />
</body>
</head>

```