<html>

<head>
<script type="text/javascript">
window.onload = function(){
myFunction = function(){
console.log("1");
} } </script>
</head> <body> Enter your name: <input type="text" id="fname" oninput="myFunction()" onpropertychange="myFunction()"> </body>
</html>
<html>

<head>
<script type="text/javascript">
window.onload = function(){
myFunction = function(){
console.log("1");
}
var oTest = document.getElementById('fname');
if(oTest.attachEvent){
oTest.attachEvent('onpropertychange',function(){
console.log("1");
});
}
else{
oTest.addEventListener('input',function(){
console.log("1");
}
);
} } </script>
</head> <body> Enter your name: <input type="text" id="fname"> </body>
</html>

 

<html>

<head>
<script type="text/javascript">
window.onload = function(){
    myFunction = function(){
        console.log("1");
    }

}
 
</script>
</head>

<body>

Enter your name: <input type="text" id="fname" oninput="myFunction()" onpropertychange="myFunction()">

</body>
</html>

input内容改变触发事件,兼容IE的更多相关文章

  1. Input 值改变触发事件

    $('#keyword').bind('input propertychange', function() { $('.close-search').show();});  

  2. html5与js关于input[type='text']文本框value改变触发事件一些属性的区别oninput,onpropertychange,onchange和文本框的value点击全选状态onclick="select();"。做购物车页面时会要用到。

    关于input[type='text']文本框value改变触发事件一些属性的区别oninput,onpropertychange,onchange和文本框的点击全选状态onclick="s ...

  3. 刷新各ifream当前页,下拉项改变触发事件js,给选中项加背景色js

    <script type="text/javascript" language="javascript"> //刷新框架各页面 function r ...

  4. 关于Input内容改变的触发事件

    1.onchange onchange 事件会在域的内容改变时触发.支持的标签<input type="text">, <textarea>, <se ...

  5. input 内容改变的触发事件

    1. onchange onchange 事件会在域的内容改变时触发.支持的标签<input type="text">, <textarea>, <s ...

  6. input标签内容改变触发的事件

    原生方法 onchange事件 <input type="text" onchange="onc(this)"> function onc(data ...

  7. 关于input内容改变的触发时间

    1.onchange onchange 事件会在域的内容改变时触发.支持的标签<input type="text">, <textarea>, <se ...

  8. 捕获input 文本框内容改变的事件(onchange,onblur,onPropertyChange比较)

    input 文本框内容改变,可以使用onchange或者onblur来判断,但onchange是在文本内容改变,然后失去焦点的时发生,onblur是在失去焦点时发生,不会自己去判断. 如: <i ...

  9. jQuery.1.9 live 代替事件 on 新增内容无法触发事件

    如果是新增 append 或者 html() 事件添加的内容,无法触发 click 事件, 在1.9 可以用live 事件来代替 1.9以后用 <div class="search-r ...

随机推荐

  1. 已知json类型根据类型封装集合

    1编写帮助类根绝url得到json public static string Post(string url) { string strURL = url; //创建一个HTTP请求 HttpWebR ...

  2. php使用技巧--之链接地址

    高效PHP程序必知的53个技巧 http://developer.51cto.com/art/201105/265953.htm 非常实用 十个PHP高级应用技巧 http://developer.5 ...

  3. OpenCV之邻域运算之最值滤波

    写了一段小程序,分享给大家! //==================================================================== // 作者 : quarry ...

  4. 如何制作按钮hover状态

    1.选中文字加背景图层 2.Ctrl+J复制图层,向下轻移. 3.点击所复制图层的背景图层,右键选中——混合选项 弹出图层样式框: 4.选择渐变叠加,将渐变——反向勾选上,确定: 5.完成,效果如图.

  5. Shell:sed流编辑器

    转载:http://blog.sina.com.cn/s/blog_ac9fdc0b0101lvdv.html sed和awk是永远地痛,学了又忘,主要是木有横向对比过,所以总把握不到精髓.它可以完美 ...

  6. SQL Server网络地址备份

    SQL Server网络地址备份 Ø  软件系统: SQL Server 各版本 1.问题描述: 在XX客户做SQL Server 到Oracle 数据迁移时,当时由于客户的SQL Server200 ...

  7. hdu 4455 动态规划

    思路:用sum[i]表示区间长度为i的不相同数的个数和,假使所有的数都不相同,那么sum[i]=sum[i-1]+n-i+1-later[i-1]; later[i-1]表示的是序列最后面的长度为i- ...

  8. 实现类似 QQ音乐网页版 的单页面总结

    最近需要对创业团队的网站进行改版,而我负责前端设计和实现. 下面是一些总结与体会: 当设计完成之前,我就跟和我配合的Java 后台说用iframe实现,结果说麻烦不肯,到最后突然对我说还是用ifram ...

  9. DOM操作在jQuery中的实用------文字提示和图片提示

    关于文字提示想必是家喻户晓,操作呢说简单一点就是在超链接中加入title属性.但是在人机交互越来越倍受恩宠的年代,依靠浏览器自带的文字提示即title属性,提示效果的响应速度就(还是人艰不拆了吧~)s ...

  10. Ehcache(2.9.x) - API Developer Guide, Cache Loaders

    About Cache Loaders A CacheLoader is an interface that specifies load() and loadAll() methods with a ...