title: javascript toggle function using php variable as id
body: <p>This is the toggle function without using a php variable as the div ID. The div ID that will be getting toggled is <code>div3</code> in the code below.</p>
  
  <pre><code>&lt;script&gt;
   function showFormcaster() { 
         $('#div3').toggle();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Because I am making a status system with many replicated divs I need the <code>div id</code> to be unique for each <code>div</code> that contains the reply box and submit button. I have decided to use the <code>id</code> from the status that will be getting replied to as the <code>div id</code> that will get toggled.</p>
  
  <p>This is the div that will get toggled</p>
  
  <pre><code>$mail .= '&lt;div id="'.$status_id.'?&gt;" class="replyholder"&gt;';
  </code></pre>
  
  <p>below are a few methods I have tried to get this to work</p>
  
  <p>METHOD1:</p>
  
  <pre><code>&lt;script&gt;
  var show;
  show = "'.$status_id.'";
  
       function showreply() { 
         $(show).toggle();
      }
  </code></pre>
  
  <p>METHOD 2:
       </p>
  
  <pre><code>&lt;script&gt;
   function showreply() { 
         $('#&lt;?php echo $status_id ?&gt;').toggle();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>METHOD 3</p>
  
  <pre><code>&lt;script&gt;
   function showreply() { 
         $('#&lt;?php $status_id ?&gt;').toggle();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I am not so good at Javascript and most of the time when I come to using it, it is guess work and Google however I can't seem to find an answer and what I have found I have tried.</p>
  
  <p>Is it even possible to do what I am trying to do and if so do you think you will be able to help me out and solve this.</p>
  
  <p>Thank you.</p>