title: Show / Hide div with jscript
body: <p>I looked all arround the site and i could not find an answer that is what i want. Perhaps my knowledge is just too little for this but im trying to learn more and more.</p>
  
  <p>Here is the thing, i have this website with several movies and after making a search in my db i return only the essential data for the user with the movies that correspond to the search parameter, the rest of the data i want to put in a div with the option to SHOW and HIDE the same div.</p>
  
  <p>That is what i have so far:</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  function showDiv() {
     document.getElementById('hiddenDiv').style.display = "block";
  }
  &lt;/script&gt;
  
  &lt;div id="hiddenDiv"  style="display:none;" class="answer_list" &gt; WELCOME&lt;/div&gt;
  &lt;input type="button" name="answer" value="Show Div" onclick="showDiv()" /&gt;
  </code></pre>
  
  <p>Detail: Im printing everything with php echo.</p>
  
  <p>Thank you very much!</p>
  
  <p>Additional info:</p>
  
  <p>All the result are shown in the same page, wich means all the divs have the same name.</p>
  
  <p>I have change my div code to:</p>
  
  <pre><code>echo "&lt;div id='$dados[id]'  style='display:none;' class='answer_list' &gt;";
  
  $dados[id] returns me the id of the data in my db.
  
  I want to change:
  
  document.getElementById('hiddenDiv') to something like document.getElementById('$dados[id') &lt;-- Shows only the last div.
  </code></pre>
  
  <p>Can it be done?</p>
  
  <p>Result comes from:</p>
  
  <pre><code>while ($dados = mysql_fetch_array($query))
  </code></pre>