title: jquery open div with dynamic id
body: <p>I want to use jQuery to open and close a div.
  But because the code that I use is dynamic and will be repeated below each other, I need to use a dynamic id.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="categoryratings-review-&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getId())?&gt;" style="display: none;"&gt;
     &lt;p&gt;Text&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;span class="showcategoryratings" id="review-&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getId())?&gt;"&gt;
     &lt;span class="showcategoryratings-text"&gt;Per category&lt;/span&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I try to use this jQuery, but I guess the php line is not working:</p>
  
  <pre><code>$(document).ready(function() {
      $('#review-&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getId())?&gt;').click(function() {
              $('.categoryratings-review-&lt;?php echo $this-&gt;htmlEscape($_review-&gt;getId())?&gt;').slideToggle("fast");
              $(this).toggleClass('active');
      });
  });
  </code></pre>
  
  <p>How do I need to edit this correctly?</p>