I have the following code and it doesn’t seem to work at all. No border is drawn. I there anything wrong? (I have jQuery included correctly because other parts, which use it, work)
<script>
$(document).ready(function() {
$('#login').css({"border":"3px solid black"});
});
function setBorder() {
$('#login').css({"border":"1px solid black"});
}
</script>
<div id="#login">
<form>
Username: <input type="text" /><input type="button" value="Log in" onclick="setBorder();"/>
</form>
</div>
Your selector matches “An element with the id ‘login'” but your element has the id ‘#login’.
Remove the
#from the ID. The character isn’t allowed in ids in HTML 4 anyway.