IE下,当一个HTML元素的属性改变的时候,都能通过 onpropertychange来捕获。例如一个 <input name="text1" />对象的value属性被页面的脚本修改的时候,onchange无法捕获到,而onpropertychange却能够捕获。
也就是说:onpropertychange能及时捕获属性值的变化,而onchange在属性值改变时还必须使得当前元素失去焦点(onblur)才可以激活该事件!onpropertychange事件只能在IE下使用

      举例:<input type="text" onpropertychange='alert("change")' />,每输入一个字符都会激活onpropertychange事件。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
猜你喜欢
  • 2021-07-06
  • 2021-07-08
  • 2022-03-08
相关资源
相似解决方案