title: jQuery custom function to javascript
body: <p>I recently write this in <strong>jQuery</strong></p>
  
  <pre><code>$.fn.my_cus_fn = function(){
      $(this.selector).click(function(e) {
          // do stuff
      });
      $(this.selector).focus(function(e) {
          // do stuff
      });
      // ................    
  }
  </code></pre>
  
  <p>Then I used it like. </p>
  
  <pre><code>$('#my_action1').my_cus_fn();
  $('.my_action2').my_cus_fn();
  </code></pre>
  
  <p>I wanted to write it using <strong>javascript</strong> only. </p>
  
  <p>I didn't find any solutin for it. Can anyone help me?</p>
  
  <p>Expecting something like</p>
  
  <pre><code>document.getElementById('my_action1').my_cus_fn();
  </code></pre>