DekGenius.com
JAVASCRIPT
jquery add disabled to button
$("#button").attr("disabled", true);
jquery button remove disabled attribute
//for a class
$('.inputDisabled').prop("disabled", false);
//for a ID
$('#inputDisabled').prop("disabled", false);
jquery remove disabled property from button
$('#edit').click(function(){ // click to
$('.inputDisabled').attr('disabled',false); // removing disabled in this class
});
jquery disable button
$('.class').prop("disabled", true);
$('#id').prop("disabled", true);
// As function
const disable = (id) => $(`#${id}`).prop("disabled", true);
enabled disabled button jquery
<a href="#" id="button" role="button"> Click me </a>
<script>
$("#button").attr("disabled", true); // disabled = true
// $("#button").attr("disabled", false); // disabled = false
// attr cannot pls switch to prop
$('#button').prop("disabled", true);
</script>
jquery remove disabled property from button
$("#edit").click(function(event){
event.preventDefault();
$('.inputDisabled').prop("disabled", false); // Element(s) are now enabled.
});
jquery disable button
function disable(i){
$("#rbutton_"+i).prop("disabled",true);
}
how to make button disabled in jquery before send
$('#btnSubmit').attr("disabled", false);
or
$('#btnSubmit').removeAttr("disabled");
disable button using jquery
// disable button using prop.
$(".button").click(function(){
// disable button
$(this).prop('disabled', true);
// do something
// below code enables button clicking after two seconds.
setTimeout(() => {
// enable button
$(this).prop('disabled', false);
}, 2000);
});
how to disable button in jquery
$("#button").attr("disabled", true);
//---------------------OR--------------------
jQuery("#button").attr("disabled", true);
// use jQuery instead of $ to avoid conflict with other JS libraies.
© 2022 Copyright:
DekGenius.com