Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

html button disabled

<button type="button" disabled>This button is disabled</button>
Comment

make button disabled

// Makes the button disabled

document.getElementById("myButtonId").setAttribute("disabled", ""); 

// Removes disabled attribute

document.getElementById("myButtonId").removeAttribute("disabled");
Comment

disable button

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

use disabled= in button

<button type="button" disabled={condition? condition_true : condition_false}>Disabled with ternary</button>

ex: disabled={coin > 0 ? buy_a_car() : "No money"}
Comment

button disabled

const textDisabled = text.length === 0 || text.trim().length === 0
Comment

button enabled

/* Selects any enabled <input> */
input:enabled {
  color: blue;
}
Comment

disable button

collector.on('collect', async i => {
    if (i.customId === 'id_1') {
        row.components[0].setDisabled(true) //disables but_1
    }
    if (i.customId === 'id_2') {
        row.components[1].setDisabled(true) //disables but_2
    }
    interaction.editReply({ content: "Click a button", components: [row] });
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery array merge 
Javascript :: jquery select radio 
Javascript :: block enter key using jquery 
Javascript :: javascript delete row by id 
Javascript :: scroll to class jquery 
Javascript :: findmany mongoose or find by multiple Ids 
Javascript :: javascript convert string to float with 2 decimal places 
Javascript :: remove value from array javascript 
Javascript :: javascript onclick 
Javascript :: js get all iframes 
Javascript :: cnpj pattern js 
Javascript :: convert string array to objectid mongoose 
Javascript :: set nested state react hooks spread operator 
Javascript :: js how to know if element touch border 
Javascript :: Chamando métodos de utilidade com consign( ) no nodeJs 
Javascript :: why request body is empty when using fetch 
Javascript :: xmlhttprequest post form 
Javascript :: how to make a discord.js 8 ball command 
Javascript :: How to install express package using npm 
Javascript :: enumerate node js 
Javascript :: expo android built is huge 
Javascript :: js find node number in div 
Javascript :: Sequelize find sort order 
Javascript :: javascript get index of object with value in array 
Javascript :: hasOwnProperty with more than one property 
Javascript :: add download buttons in datatable 
Javascript :: react native inverted reverse array 
Javascript :: get html lang attribute jquery 
Javascript :: node js try catch 
Javascript :: xmlhttprequest readystate 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =