title: Uncaught SyntaxError: Unexpected token else (bbcode error on phpBB)
body: <p>I'm using phpBB as my forum and I want  to implement a spoiler tag. I have searched online on how to implement this custom bbcode and I always find the same code:</p>
  
  <pre><code>&lt;div style="margin-bottom: 2px;"&gt;
  &lt;b&gt;Spoiler! &lt;/b&gt;
  &lt;input value="Show" style="margin: 0px; padding: 0px; width: 60px; font-size: 10px;" onclick="if(this1.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline') { this1.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }else{ this1.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button"&gt; &lt;/div&gt;
  &lt;div style="border: 1px inset; padding: 6px;"&gt;
  &lt;div style="display: none;"&gt;{TEXT}&lt;/div&gt; &lt;/div&gt;
  </code></pre>
  
  <p>However, in Chrome I get the following error: "Uncaught SyntaxError: Unexpected token else", and in Firefox it says: "Uncaught SyntaxError: Unexpected token else"</p>
  
  <p>Does anybody know what gives the error?</p>