I have an html page with some <style>/*I need to extract this*/</style>
and how can I extract that styles and get html without styles?
I would suggest you you use all:initial or all:unset so that you could make the element use default style.
I don't think you could create variable for the class, but you could use classList.add and classList.remove to switch.
document.querySelector('button').onclick= function(){
document.body.classList.add("nostyle");
this.classList.add('nostyle');
}
.nostyle{
all:revert;
}
body{
background:black;
}
button{
color:white;
background:black;
}
<button >Remove</button>