jQuery – enable/disable all style sheets on page on click

后端 未结 6 1193
情书的邮戳
情书的邮戳 2020-12-06 06:05

Is it possible to detect all style sheets on the current page with a click of a ‘disable/enable CSS’ button and disable them on the first click so none of the styling applie

6条回答
  •  Happy的楠姐
    2020-12-06 06:47

    $('link[rel="stylesheet"]').attr('disabled', 'disabled');
    

    this should disable all of them, then the opposite to renable them:

    $('link[rel="stylesheet"]').removeAttr('disabled');
    

提交回复
热议问题