title: How do I pass an HTML element as an argument to a Javascript function?
body: <p>i have a chat window which has a close button(input type='image') and onclick i want to remove the chat window from the parent node and i use this code</p>
  
  <pre><code>closeBtn.setAttribute("onclick", "return closeContainer(cc" + friendId + ");");
  </code></pre>
  
  <p>please note that this button is created through javascipt and the cc223423432 (say) will be the id of the chat window</p>
  
  <p>here is my code to remove it</p>
  
  <pre><code>function closeContainer(ccId) {
      var x = ccId;
      x.parentNode.removeChild(x);
      //..........
  }
  </code></pre>
  
  <p>now in IE8 and Chrome it finds the passed argument as HTMLDIV and works fine but in firefox it give an error <strong>cc223423432 is undefined</strong> 
  any idea why???</p>
  
  <p>i know i can always do a document.getElementByID and then remove it but please if there is anything i am missing please tell</p>