title: onclick not calling javascript function
body: <p>I'm having a simple issue with calling a javascript function.  I've been playing with this for hours and I can't see the problem.  Hopefully another perspective can help.</p>
  
  <p>in the  of my php file:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function showShareDiv(objid){
      var div = document.getElementById('share'+objid);
      if (div.style.display=='none'){
          div.style.display='block';
      }
      else{
          div.style.display='none');
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is just to show/hide a div with name "share"+number (eg. share104).  When I look at the source the $obj->id correctly names the div and function onclick name.</p>
  
  <p>Here is the button:</p>
  
  <pre><code>&lt;div id="sharebutton" style="width:100%;" onclick="showShareDiv('&lt;?=$obj-&gt;id?&gt;');"&gt;
    &lt;center&gt;Share&lt;/center&gt;
  &lt;/div&gt;
  &lt;div id="share&lt;?=$obj-&gt;id?&gt;" style="display:none;"&gt;
    SHARE BUTTONS GO HERE
  &lt;/div&gt;
  </code></pre>
  
  <p>Any help is appreciated.</p>