How to check string values in javascript : <p>I'm trying to compare the value of a string and if the first two values = @@ then call a div</p>

<p>This is my code example but doesn't seem to work. Is this the correct approach or am I off mark. Be gentle, I'm new to javascript.</p>

<pre><code>&lt;script type = "text/javascript"&gt;
var str = "@@this is the line for the test";
if (str.substring(0,2) == "@@" {
    document.write(str.substring(0,2));
} else {
    document.write("found nothing");
}
&lt;/script&gt;
</code></pre>
