Hiding an iput field on an option select drop down
Hey Guys. I have wrote a small piece of code that should hide the credit card text field if a user selects cash. I am not sure if my selector statement is incorrect or my .click() function is incorrect since its not an actual click. It a selected option.
By the way my jquery code is all the way at the bottom of the after the HTML gets loaded.
Below is my code. Any help would be really appreciated!
$("option>select(eq(1))").click(function(){
$("#credit_card_number").hide();
});
<tr><td>Credit Card Number </td> <td><input type='number' name='credit_card_number' id='credit_card_number'></td></tr>