Need Javascript If the Sequence match the Html Structure
<p>Javascript expert this is my template coding:</p>
<pre><code>&lt;html&gt;

&lt;head&gt;        
&lt;/head&gt;

&lt;body&gt;

&lt;div id='top'&gt;
  &lt;h2&gt; This is my website headline &lt;/h2&gt;
&lt;/div&gt;


&lt;div class='outer-wrapper'&gt;
  &lt;h3&gt;This is content area for main blog &lt;/h3&gt;
 &lt;/div&gt;


&lt;div class='footer'&gt;
  &lt;h4&gt; This is footer content area &lt;/h4&gt;
&lt;/div&gt;


&lt;!--Copyright Structure Start--&gt;

&lt;div id='copyright'&gt;
  &lt;div id='container'&gt;
    &lt;p&gt;Copyright 2016. Designed By &lt;a href='#'&gt;Company&lt;/a&gt; 
        &lt;/p&gt;
      &lt;/div&gt;
  &lt;/div&gt;  

 &lt;!--Copyright Structure End--&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>i have the below html structure that is used in the template.</p>
<pre><code>&lt;div id='copyright'&gt;
  &lt;div id='container'&gt;
    &lt;p&gt; Designed By &lt;a id='doom' href='http://www.example.com'&gt;Company&lt;/a&gt; 
        &lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
</code></pre>
<br/>
<br/>
<p><strong>Case 1:</strong> Now,i want if the same sequence exist <strong>#copyright &gt; #container &gt; p &gt; a#doom</strong> in the the html structure inside the template Then its ok, if any if these has removed, then redirect my page to example.com.</p>
<pre><code>   &lt;div id='copyright'&gt;
      &lt;div id='container'&gt;   
        &lt;/div&gt;
      &lt;/div&gt;
</code></pre>
<p>See the structure above has no <strong><code>&lt;p&gt;&lt;/P&gt;</code></strong> tag, now it should be redirected.</p>
<br/>
<br/>
<br/>
<p><strong>Case 2:</strong> If there is added extra other html tag inside my html structure in the template rather than these tags: <strong>#copyright #container P and a#doom</strong>. then it should also redirected.
<br/></p>
<pre><code>&lt;div id='copyright'&gt;
  &lt;div id='container'&gt;
  &lt;div id='wrap'&gt;
    &lt;p&gt; Designed By &lt;a id='doom' href='http://www.example.com'&gt;Company&lt;/a&gt; 
        &lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>
<p>See the structure has extra <strong>div wrap</strong> now, it should redirected to example.com because it does not match the sequence.</p>
<p>I hope someone will give the script soon. thanks.</p>