Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery add disabled to button

$("#button").attr("disabled", true);
Comment

jquery disable button

$('.class').prop("disabled", true);
$('#id').prop("disabled", true);

// As function
const disable = (id) => $(`#${id}`).prop("disabled", true);
Comment

disable all buttons jquery

$('button').removeAttr('disabled')
Comment

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>
Comment

jquery disable button

function disable(i){
    $("#rbutton_"+i).prop("disabled",true);
}
Comment

disable button click jquery

function load(recieving_id){
    $('#roommate_but').prop('disabled', true);
    $.get('include.inc.php?i=' + recieving_id, function(data) {
        $("#roommate_but").html(data);
    });
}
Comment

How to disable and enable a button in 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);
});
Comment

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.
Comment

PREVIOUS NEXT
Code Example
Javascript :: get all data attributes jquery from multiple elements 
Javascript :: vue js count down timer 
Javascript :: infinit for loop js 
Javascript :: mongoose count 
Javascript :: anonymous function javascript 
Javascript :: react router remove location state on refresh 
Javascript :: next-dev.js?3515:32 Warning: Prop `className` did not match. Server Client 
Javascript :: Get the current tab 
Javascript :: format dates momentjs 
Javascript :: compare date and time in js 
Javascript :: Vue JS Production mode refresh causing 404 error 
Javascript :: getting te value of select multiple value 
Javascript :: jquery dynamic event binding 
Javascript :: axios node js 
Javascript :: phaser2 align text center 
Javascript :: change color react icon 
Javascript :: paragraph antd 
Javascript :: js string replace array 
Javascript :: disable URL encoder javascript 
Javascript :: jquery selectors attribute ends with 
Javascript :: return nothing javascript 
Javascript :: toLocalString 
Javascript :: array pop 
Javascript :: try catch javascript 
Javascript :: random unique number generator javascript 
Javascript :: javascript filter array match includes exact 
Javascript :: js remove all child elements from html 
Javascript :: datatable bootstrap cllick on specific button 
Javascript :: CSRF token in js 
Javascript :: autocomplete react jsx attributes vscode 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =