document.observe('dom:loaded', function() {

后端 未结 2 2120
甜味超标
甜味超标 2021-02-10 04:27

Is there a way to have this prototype js trigger only when dom is changed and not loaded?

2条回答
  •  悲&欢浪女
    2021-02-10 05:02

    you can observe elements changing like this

    $('element').observe('change',function(e){ } );
    

    This is reserved for form elements though - textarea, select and input.

    The final code would look something like:

    document.observe('dom:loaded', function() {
        $('element').observe('change',function(e){
        // do something here
        });
    });
    

提交回复
热议问题