I’m new to JQuery and trying to implement a function which will hide an input element on click. I keep getting a syntax error.
HTML Code:
<div id="header">
<div id="grad">
<div id="blah">
convo
</div>
</div>
<div class="topimage"><img src="assets/scrybe.jpg" width="100px"></div>
</div>
<form>
<input id="filter" onkeyup="blah.test()" placeholder="Search" type=
"text">
</form>
<div id="leftcontainer">
<input id="userlist" placeholder="Find people" type="text">
</div>
JQuery Code:
var usersearch = {
$('#filter').click();
//ready: function(){
$("#filter").click(function() {
$(this).hide();
});
//}
};
//usersearch.ready();
I’ve got it working, check this jsFiddle – http://jsfiddle.net/tHbGh/
Change your JQuery to this: