title: Is this break statement valid in jquery/javascript?
body: <p>I have a function which selects a text based on the input string. If both matches i make it selected. PFb the function,</p>
  
  <pre><code>function setDropdownTextContains(dropdownId,selectedValue,hfId){
              $('#'+dropdownId+' option').each(function(){
  
                       if($(this).text() === selectedValue){
                           $(this).attr("selected", "selected");
                           break;
                       }
              });
                   $('#'+hfId).val("ModelName doesnt match");
          }
  </code></pre>
  
  <p>I get the below error <code>unlabeled break must be inside loop or switch</code> ... What am i doing wrong??</p>