<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function () {
$('input').bind('input propertychange', function() {
$len = $(this).val().length;
if ($len == 0) {
$('span').html('');
} else if ($len >= 6) {
$('span').html($(this).val().length).css('color', 'black');
} else {
$('span').html($(this).val().length).css('color', 'red');
}
})
})
</script>
</head>
<body>
<form>
<input maxlength="12" type="password" placeholder="password">
<span></span>
</form>
</body>
</html>
通过右键菜单菜单中的剪切和删除命令删除内容的时候不会触发, 怎么能触发呢?
相关分类