I'm fairly new to jQuery but I know a couple of things. However when I try to do events it never seems to work.
HTML code:
$(document).ready(function() {
$("input[type=password]").focus(function() {
$("#password_information").show();
}).blur(function() {
$("password_information").hide();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form>
<ul>
<li>
<label for="username">Username:</label>
<span><input id = "username" name = "username" type = "text"></span>
</li>
<li>
<label for="pswd">Password:</label>
<span><input id = "pswd" type = "password" name = "pswd"></span>
</li>
<li>
<button type="submit">Register</button>
</ul>
</form>
<div id="password_information">
<h4> Password must meet the following requirements:</h4>
<ul>
<li id="letter" class="invalid">At Least <strong>one letter</strong></li>
<li id="captial" class="invalid">At Least <strong>one captial</strong></li>
<li id="number" class="invalid">At Least <strong>one number</strong></li>
<li id="length" class="invalid">At Least <strong>8 characters</strong></li>
</ul>
</div>
This is in an external script within in the same location as the html file.
For some reason it doesn't work, could you explain why or help me fix that?