event handler attachment jquery

JavaScript
$( "#foo" ).one( "click", function() {
  alert( "This will be displayed only once." );
});

Source

Also in JavaScript: