Css Disable Button Code Example


Example 1: javascript how to disable a button


//Using Javascript
//Disabling a html button

document.getElementById("Button").disabled = true;
//Enabling a html button

document.getElementById("Button").disabled = false;


//Using jQuery
//Disabling a html button

$('#Button').attr('disabled','disabled');
//Enabling a html button

$('#Button').removeAttr('disabled');

Example 2: style disabled button


button:disabled,
button[disabled]{
border: 1px solid #999999;
background-color: #cccccc;
color: #666666;
}

Example 3: css disable button click


button.disabled{
pointer-events: none;
}

Example 4: html button disabled



Example 5: css for disabled button


/* CSS Selectors for CSS2 and CSS3 both */
button:disabled,
button[disabled]{
border: 1px solid #999999;
background-color: #cccccc;
color: #666666;
}

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable