本文实例讲述了jquery选择器绑定事件及修改内容的方法。分享给大家供大家参考。具体实现方法如下:
代码如下:
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<title>hello world jquery!</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
</head>
<body>
<p id="pmsg">hello world!</p>
<input id="btnshow" type="button" value="显示" />
<input id="btnhide" type="button" value="隐藏" /><br />
<input id="btnchange" type="button" value="修改内容为hello world,cnblogs!" />
<script type="text/javascript" >
$("#btnshow").bind("click", function(event) { $("#pmsg").show();});
$("#btnhide").bind("click", function(event) { $("#pmsg").hide();});
$("#btnchange").bind("click", function(event){ $("#pmsg").html("hello world, cnblogs!"); });
</script>
</body>
</html>
如对本文有疑问, 点击进行留言回复!!
轻松解决 org.apache.taglibs.standard.tlv.JstlCoreTLV 困惑
vert实践五——Json?Protocol Buffer?FlatBuffers?
[基于tensorflow的人脸检测] 基于神经网络的人脸检测8——验证训练好的神经网络
selenium + ajax抓取英雄联盟全部英雄的详细信息及多线程保存全部皮肤图片到本地
网友评论