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

后端 未结 6 1195
情书的邮戳
情书的邮戳 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条回答
  •  爱一瞬间的悲伤
    2020-12-06 06:23

    Here is another method that you can try to do that thing.

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

    and in other hand you remove that attribute

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

提交回复
热议问题