我的页面上有 2 个元素,我单击 button1 它应该隐藏,而当我单击块元素时
背景颜色应更改为绿色..
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#button1").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<button id="button1">Button1</button>
<p>This is a block element</p>
</body>
</html>