title: Pass CSS id as a parameter in JavaScript function
body: <p>I've a CSS id which shows a small red ball and a JAVASCRIPT function. I want to pass the CSS id as a parameter in the JavaScript function. I've seen a lot of tutorials but can't figure it out. Here are the codes:</p>
  
  <p>CSS code</p>
  
  <pre><code>#projectile{
      position: absolute;
      background-color: #ff0000;
      left:176px;
      top: 486px;
      width:10px;
      height:10px;
      border-radius: 8px;
      z-index: 9;
  }
  </code></pre>
  
  <p>JAVASCRIPT code</p>
  
  <pre><code>function gofish(projectile_id){
  var projectile = getElementbyId(projectile_id);
  start_x = projectile.offset().left;
  start_y = projectile.offset().top;
  
  function init()
  { setTimeout("gofish('projectile')", 500); }
  </code></pre>