Hi everyone, I am so new to javascript and it is really giving me a micrain. It looks easy but tend to be hard. Atleast for me since I am a beginner.
I need help please. I need to make work with the element getElementById
I have tried numerous way for days and nothing is working. All I am trying to do is when onchange the user go on the option credit card, the credit card information box shows. This is what I have in the script tag. Can some please tell me what am I doing wrong and what should I have done?
function CheckForCreditCard()
if document.getElementById("divCreditCardInfo").options3].selected == true)
{
CreditCardInfo.style.visibility = "visible";
}
below is in the body
<select name="selPayment" onchange="CheckForCreditCard();">
<option value="Cash">Cash</option>
<option value="Check">Check</option>
<option value="Credit Card" selected="selected">Credit Card</option>
</select>
<div id="CreditCardInfo"> <br />
Card Number:
<input name="selCreditCardInfo" size="20" type="text" />
Month:
<input type="text" name="txtMonth" size="4" />
Year:
<input name="txtYear" size="4" type="text" />
</div>