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

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

disable all buttons jquery

$('button').removeAttr('disabled')
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

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);
});
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 :: node js check if called from command line 
Javascript :: remove element from array by name javascript 
Javascript :: loadtest node 
Javascript :: how to change background image dynamically in react 
Javascript :: sequelize migration 
Javascript :: mongoBD update increment a value by 2 
Javascript :: text overflow ellipsis two lines react native 
Javascript :: How to send form data from react to express 
Javascript :: how to make a confirm popup in vue 
Javascript :: how to get element by class name javascript 
Javascript :: react context 
Javascript :: format javascript date 
Javascript :: merge-sort js 
Javascript :: primitive data types in javascript 
Javascript :: jquery get img src 
Javascript :: js get text from html string 
Javascript :: photo in React native 
Javascript :: replace each string by another string javascript 
Javascript :: join in mongodb 
Javascript :: js if else statement one line 
Javascript :: install bootstrap in react 
Javascript :: react testing for links 
Javascript :: convert a string into an integer 
Javascript :: get minutes and seconds of long seconds 
Javascript :: npm sendgrid 
Javascript :: li dots 
Javascript :: comment out in javascript 
Javascript :: jquery datatable table header not increasing on expanding 
Javascript :: Integrating Axios with React Hooks 
Javascript :: next day date javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =