Reputation: 100130
How can I disable a style block?
<style disabled="true">
progress {
background-color: rebeccapurple;
border: 0;
border-radius: 9px;
height:25px;
width:300px;
}
</style>
the above doesn't seem to work, is it possible to do it this way? Or do I need to disable it programmatically?
Upvotes: 2
Views: 551
Reputation: 286
Try this:
<style id="switch">
body{
background-color: gray;
}
</style>
<script>
$(document).ready(function(){
$('.button').click(function(){
document.getElementById("switch").disabled=true;
});
});
</script>
<html>
<body>
<a href="#" class="button"><button>Button</button></a>
</body>
</html>
Setting an id to the style tag will control specific css. You can re-enable it by changing disabled back to false. Hope that works.
Upvotes: 1