好像火狐和chome都没有onpropertychange事件,测试无效。 那我现在在js里改了值想触发一个事件要怎么做?

解决方案 »

  1.   

    火狐和chome  应该是oninput吧?var dom = document.getElementById('这里写文本框ID');
    dom.onpropertychange = dom.oninput = function(){
        alert('文本框内容发生了改变');
    }这样写就兼容了
      

  2.   


    不能直接这样写么?
    <input type="text" name="period_end{$ii}" id="period_end{$ii}" value="{$stop_h[$day][$i]}:{$st
    op_m[$day][$i]}" class="edit" onclick="_SetTime(this)" onpropertychange="_CheckPeriod(this)" oninput="_CheckPeriod(this)">