I want to fade in an element with JQuery code when a inputfield is clicked. However, I cannot seem to get it to work, when the selector is placed inside the form. If I remove the selector outside the form it works fine. Is there any work-aroud for this? Or, maybe JQuery code does not execute inside a form? Here is my code:
<form action="newBet.jsp" method="get">
<fieldset>
<input id="test" type="submit" name="update" value="✎"/>
<input class="form-control" id="div1" style="display:none;" type="number"/>
</fieldset>
</form>
$(document).ready(function(){
$("#test").click(function(){
$("#div1").fadeIn();
});
});
If I place the selector #test outside the form it works fine, but I want to execute the JQuery inside the form.