Using Mod operator. I wrote a script to reads an integer and to displays whether is an odd or even number
<p>This is my first ever using mod operator. What I've done so far is declare and initialize a variable and parsed the string to an integer. I used a if statements to determine whether the remainder is an even or odd number. Then I used document.write to display the output for each if statement. </p>

<p>But the output is not showing in the browser. The error console message is that I have an invalid assignment on the left-hand side. I tried switching the left-hand side to the right-hand side but the error is still invalid on the left-hand side. </p>

<p>The other thing is I'm not sure whether I should be using the parse since I read that the mod operator attempts to convert the string to a number. But I'm a little confused on this. </p>

<p>Anyway, here is the code: Any suggestions?</p>

<pre><code>&lt;?xml version ="1.0" encoding = "utf-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1   /DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns - "http://www.w3.org/1999/xhtml&gt;
&lt;html&gt;
&lt;head&gt; 

&lt;script type="text/javascript"&gt;
 //Declare variables

 var num = 18;

 //converts to integer
 num = parseInt(num);

 //write to output
 if(num % 6 = 0){
 document.write(% + "&lt;h2&gt; is an even number&lt;/h2&gt;");
 }
 if(num % 6 != 0){
 document.write(% + "&lt;h2&gt; is a odd number&lt;/h2&gt;");
 }

 //end if


 &lt;/script&gt;

 &lt;/head&gt;
 &lt;body&gt;
</code></pre>

<p>
</p>
