Set button to disabled state in the beginning If the input value of the required field is empty, let the button remain disabled. It is used to submit the content. Output: Clicking on the Get Free button: Clicking on the Get Premium button: Clicking on the Reset options button: Method 2: Using attr method: It is similar to the above method and more suitable for older jQuery versions. $("#rbu What is the best way to invert this behaviour? generated HTML: