title: Jquery - onclick event - factorization
body: <p>I use video.js seek option with functions to set time to seek:</p>
  
  <pre><code>$('#0s').click(function(e){
      e.preventDefault();
      player.currentTime(0);
  });
  
  $('#10s').click(function(e){
      e.preventDefault();
      player.currentTime(10);
  });
  
  $('#20s').click(function(e){
      e.preventDefault();
      player.currentTime(20);
    });
  });
  </code></pre>
  
  <p>With these links:</p>
  
  <pre><code>&lt;a href="#" id="0s"&gt;0s&lt;/a&gt;
  &lt;a href="#" id="10s"&gt;10s&lt;/a&gt;
  &lt;a href="#" id="20s"&gt;20s&lt;/a&gt;
  </code></pre>
  
  <p>How to use just one function ?
  My try:</p>
  
  <pre><code>$(".link1").click(function(e){
  
      e.preventDefault();
      var time = $('this').attr('time');
      player.currentTime(time);
  
  });
  </code></pre>
  
  <p>With this link: </p>
  
  <pre><code>&lt;a href="#" id="0s" class="link1" time="0"&gt;0s&lt;/a&gt;
  &lt;a href="#" id="10s" class="link1" time="10"&gt;10s&lt;/a&gt;
  &lt;a href="#" id="20s" class="link1" time="20"&gt;20s&lt;/a&gt;
  </code></pre>
  
  <p>They provide this url to test code:
  <a href="http://jsbin.com/ukIDoSa/4/edit?html,js,output" rel="nofollow">http://jsbin.com/ukIDoSa/4/edit?html,js,output</a></p>