title: Using Jquery off().on() or just on()
body: <p>I know that we can attach events with the jQuery <code>on()</code> function and remove them again with <code>off()</code>.</p>
  
  <p>In an existing project I do sometimes come across code similar to this:</p>
  
  <pre><code>$("#SomeId").off("click").on("click");
  </code></pre>
  
  <p>or sometimes when using namespacing similar to this:</p>
  
  <pre><code>$("#SomeId").off("click.namespace").on("click.namespace"); 
  </code></pre>
  
  <p><strike>As far as I know you can only attach a single event to a specific namespace of the event.</strike>  </p>
  
  <p>For example if I simply do <code>on("click")</code> it will attach my specified function, <strike>overwriting the current function assigned</strike>, adding to the "click" event.  </p>
  
  <p>If I do <code>on("click.namespace")</code> it will attach my specified function <strike>overwriting the current function assigned</strike>, adding to the <code>click.namespace</code>.</p>
  
  <p>What is the point removing any events by chaining an <code>off("click")</code> to the <code>on("click)</code> if <code>on()</code> already replaces any functions assigned to the specified event/event.namespace?</p>
  
  <p>Is it redundant syntax in our code or is there a reason for it which I have missed?</p>
  
  <p><strong>Edit - Thank you <code>kapa</code></strong><br>
  I feel a bit silly now, I corrected my faulty knowledge above. Executing <code>on("click.namespace1")</code> several times I observed now that the <code>data("events")</code> object kept adding to the click event array.</p>
  
  <p>I think that answers my own question there. That is why one would use <code>off("event.namespace")</code> to ensure nothing else is attached to that exact event/event.namespace.</p>