function when select option in javascript code example
Example 1: jquery enable submit button
//jQuery 1.6+ use:
$("#submitButtonID").prop('disabled', true); //disable
$("#submitButtonID").prop('disabled', false); //enable
//jQuery 1.5 and below use:
$("#submitButtonID").attr('disabled','disabled'); //disable
$("#submitButtonID").removeAttr('disabled'); //enable
Example 2: javascript function with condition in parameter
function myFuntionName(condition) {
//this example uses an if statement
if (condition) {
//code
}
}
//call the function
let a = 8;
myFunctionName(a > 7);//a > 7 is converted into boolean before it is processed in the function