title: why "</script>" in script tag treat as closing tag but "<h1> hlo </h1>" not render anything?
body: <p>I was reading a book and then I read this line :-
  "The HTML parser don't know about your JavaScript code; it treats it like any other text". So if we write:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
        alert("first");
        var string = "&lt;/script&gt;";
  &lt;/script&gt;
  </code></pre>
  
  <p>we get an error because that <code>"&lt;/script&gt;"</code> works as a closing tag to the HTML parser, and that second line <code>&lt;/script&gt;</code> work as close of script then that script tag executed, and gives :- </p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token ILLEGAL
  </code></pre>
  
  <p>even that first <code>alert()</code> not executed? I don't know why? But my main question is that if <code>"&lt;/script&gt;"</code> treated as tag then when we write something like this:</p>
  
  <pre><code>var str = "&lt;h1&gt; hello world &lt;/h1&gt;"; 
  </code></pre>
  
  <p>then this doesn't render any "hello world" on screen? According to the previous example, the HTML parser should treat that string as HTML tags as well, but it did not? Can anyone to explain me? Sorry for bad English :(</p>