Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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"}
 
PREVIOUS NEXT
Tagged: #button
ADD COMMENT
Topic
Name
7+6 =