<html>
<head>
<script type="text/javascript" src="http://www.zlovezl.cn/static/js/jquery-1.4.2.min.js"></script>
</head>
<body>
<p>
使用oninput以及onpropertychange事件检测文本框内容:
</p>
<p>
<textarea name="content" id="inputorp_i" autocomplete="off"></textarea>
<span id="inputorp_s"></span>
<script type="text/javascript">
//先判断浏览器是不是万恶的IE,没办法,写的东西也有IE使用者
var bind_name = 'input';
if (navigator.userAgent.indexOf("MSIE") != -1){
bind_name = 'propertychange';
}
$('#inputorp_i').bind(bind_name, function(){
$('#inputorp_s').text($(this).val());
})
</script>
</p>
</body>
</html>
阅读(149) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<head>
<script type="text/javascript" src="http://www.zlovezl.cn/static/js/jquery-1.4.2.min.js"></script>
</head>
<body>
<p>
使用oninput以及onpropertychange事件检测文本框内容:
</p>
<p>
<textarea name="content" id="inputorp_i" autocomplete="off"></textarea>
<span id="inputorp_s"></span>
<script type="text/javascript">
//先判断浏览器是不是万恶的IE,没办法,写的东西也有IE使用者
var bind_name = 'input';
if (navigator.userAgent.indexOf("MSIE") != -1){
bind_name = 'propertychange';
}
$('#inputorp_i').bind(bind_name, function(){
$('#inputorp_s').text($(this).val());
})
</script>
</p>
</body>
</html>
相关热门文章
给主人留下些什么吧!~~
评论热议