jQuery ubinding a click event after first click

This article looks at using jQuery unbind to remove a click event after the first click. As an example we'll be creating a simple search box the gets displayed on first click and would do the search on second click. As always don't forget to include jQuery!


<input type='text' id='searchBox' />
<input type='button' id='searchButton' value='search' />


$( document ).ready(function() {

        return false;



Sign Up
comments powered by Disqus

Popular Tags

Need a web developer?

If you'd like to work with code synthesis on your next project get in touch via the contact page.