How to register click event only once?
<p>I am trying to register click event once to my element in my project.</p>

<p>I have simplfy my codes and basically my structure looks like the following:</p>

<pre><code>function objectParent(){

}

objectParent.prototype.click=function()(

   $('#create').click(function(){
     var var1=new objectchild();
         var1.add();
   })

}

function objectchild(){

}

objectchild.prototype.add=function()(

  //The '#aButton' click event will be registered 4 times if the '#create' button is clicked 4 times.
  //so the alert will pop 4 times when 'aButton' is clicked which is not what I wanted.

  //I can use $('#aButton').unbind('click') to remove the click event but I have many buttons in my project
  //and I want to have better solution for this.

  $('#aButton').click(function(){
     alert('click')
   })

}

var test=new objectParent()
    test.click();
</code></pre>

<p>html</p>

<pre><code>&lt;a id='create' href='#'&gt;test&lt;/a&gt;

//everytime this &lt;a&gt; is clicked, it will create a new objectchild object 
//after click 4 times of this button and click 'aButton', it will pop the alert box 4 times
//I know it register click event 4 times to the 'aButton' 
//I only want to pop the alert box once.

//I can use $('#aButton').unbind('click); to remove the click event but I have many many buttons in my codes
//ex bButton, cButton...etc. I want to have a better approach for my codes.

&lt;a id='aButton' href='#'&gt;button&lt;/a&gt;
</code></pre>

<p>I hope I explain my problem well. Thanks for the help!</p>
