jQuery/HTML - Disable OnClick

前端 未结 7 1028
面向向阳花
面向向阳花 2020-12-20 00:29

as the title says I\'m trying to disable OnClick for specific

7条回答
  •  误落风尘
    2020-12-20 00:54

    Simple form, combination jquery with javascript.

    // To disable:    
    
    $('#test').each(function (){
        this.style.pointerEvents = 'none'; 
    }); 
    
    // To re-enable:
    $('#test').each(function (){
        this.style.pointerEvents = 'auto'; 
    }); 
    

    So, you can change the selector for multiple tags

提交回复
热议问题