<label for="dessert">What is your favourite dessert?*</label>
<input type="text" id="dessert" onchange="checkForm()"><br>
<div id="dessertmsg"> </div>
<input type="submit" value="Submit" id="subbutton" disabled>
I want to show the button. To show the button, I want my validation to be true which is :
function checkForm()
{
var dessert = document.getElementById("dessert").value;
if(dessert == "cake"|| dessert == "cookie" || dessert == "icecream"){
When its true, i want the button to be enabled. I know i have to use disabled: False but how would i write the line of code for that? document.getElementById(what is the id for the disabled)??
Example: http://jsfiddle.net/3NudE/ (with 3 nudes, woo!)