I'm not sure why this isn't working? I've tried a couple methods and looked around, but none of the examples work for me. My code:
HTML
<div id='SearchBar'>
<form id='SearchBar'>
<input placeholder='Search' id='SearchBar'></input>
</form>
</div>
CSS
#SearchBar{
background:#ffffff;
width:224px;
height:32px;
float:right;
}
form#SearchBar {
width:100%;
height:100%;
}
input#SearchBar {
font-size:16px;
border:none;
width:208px;
height:32px;
padding:0 8px;
}
input#SearchBar:focus{
outline-color:#2c5aa0;
}
jQuery
$('input#SearchBar').keypress(function(event) {
if (event.which == 13) {
window.location = list.html; //or submit or do whatever
}
});
Any help is appreciated. Where am I going wrong?