Wednesday, 7 August 2013

JQuery Selectors: Selecting the submit button but not the close button

JQuery Selectors: Selecting the submit button but not the close button

javascript:
<script>
$('#submit').click(function () {
$("p").show("slow");
});
</script>
attempt two:
<script>
$("input[type='submit']").click(function () {
$("p").show("slow");
});
</script>
html:
<form>
username:<br>
<input type="text" name="un"><br>
password:<br>
<input type="password" name="pw"><br>
<input type="checkbox" name="pw">
remember me<br>
<p><a href="recover.php">recover password</a></p>
<p><input type="submit" value="Submit" id="submit"></p>
<p style="display: none; color:cc0000">Authentication failed.</p>
<p><button onclick="window.top.hidePopWin()">Close</button></p>
</form>
Am I messing up my syntax on the selectors here? Doesn't seem to display
the hidden message using either method..

No comments:

Post a Comment