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

后端 未结 2 491
孤城傲影
孤城傲影 2021-02-10 04:05

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

2条回答
  •  逝去的感伤
    2021-02-10 04:56

    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
        });
    });
    

提交回复
热议问题