title: How to solve this Javascript/Razor prolem?
body: <p>I try to add the following javascript code.   </p>
  
  <pre><code> &lt;script&gt; 
      @if (ViewBag.checkedArtikel != null)
      {
          foreach (int ac in ViewBag.checkedArtikel)
          {
              String temp = "'#addartikel" + ac + "'";
              &lt;text&gt; $(@temp).toggleClass('down');&lt;/text&gt;
          }
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>If i leave out the script tag i get the right jquery commands:</p>
  
  <pre><code>$('#addartikel1').toggleClass('down');
  </code></pre>
  
  <p>But with the script tag i get this error:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token &amp;
  </code></pre>