Javascript loop continue,or break to display?
<p>Javascript loop continue,or break to display?</p>

<p>This is my code use for show or hide some data in <code>table</code></p>

<pre><code>if (type=='SHOW') {
  for(var i = 0; i&lt;list_tr.length; i++) {
             document.getElementById(list_tr[i]).style.display = '';
  }
else if (type=='SHOW_EXCEPT'){
  document.getElementById(list_tr[0]).style.display = 'none';
  document.getElementById(list_tr[1]).style.display = '';
    for(var i = 2; i&lt;list_tr.length; i++) { 
        document.getElementById(list_tr[i]).style.display = 'none';
     }
}else{
    for(var i = 0; i&lt;list_tr.length; i++) { 
        document.getElementById(list_tr[i]).style.display = 'none';
  }
}
</code></pre>

<p>In <code>else</code> case:</p>

<p>I want to hidden all but show <code>list_tr[2]</code> if<code>type=='SHOW_EXCEPT'</code></p>

<p>How can I do in this case?</p>

<p>thanks</p>
