jQuery append div with if condition
<p>I have this append statement</p>

<pre><code>$("#questions").append($("&lt;tr&gt;&lt;td&gt;" + if(value.NA == true) { + "&lt;input type='checkbox' id='" + value.Question_ID + "-na' class='na' /&gt; " + } + "&lt;/td&gt;");
</code></pre>

<p>I am trying to add a condition to the append, but I get this error:</p>

<pre><code>Uncaught SyntaxError: Unexpected token if
</code></pre>

<p>I am assuming this if is illegal, what would be the best way to accomplish what I am trying to accomplish?</p>