I have a Button created just in HTML and CSS, and I need to have someone click it, a <div>
block changes its background-color
. With this maybe:
$(document).ready(function(){
$('#button_on-off').click(function(){
$(".bloco").css('background-color', 'rgba(255, 0, 0, 0.5)');
});
});
But I want it to be transparent when the button is ON and when the button is OFF it will be colored.
Using JQuery.
Well, I already left everything commented and prepared in jsfiddle for you to help me.
Do not link to the HTML or CSS code, I believe you will not need it, you only need to work on js.
Just open in a new Guide: link .