Event on a disabled input

前端 未结 10 2694
攒了一身酷
攒了一身酷 2020-11-21 15:53

Apparently a disabled is not handled by any event

Is there a way to work around this issue ?



        
10条回答
  •  南旧
    南旧 (楼主)
    2020-11-21 15:58

    OR do this with jQuery and CSS!

    $('input.disabled').attr('ignore','true').css({
        'pointer-events':'none',
         'color': 'gray'
    });
    

    This way you make the element look disabled and no pointer events will fire, yet it allows propagation and if submitted you can use the attribute 'ignore' to ignore it.

提交回复
热议问题