Tuesday, November 5, 2013

Open link in new window or tab using Javascript


  <script type="text/javascript" language="javascript">
    function MM_jumpMenu(targ, selObj, restore) { //v3.0
       if (selObj.options[selObj.selectedIndex].value.indexOf("http:") >= 0) {
           eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
           if (restore) selObj.selectedIndex = 0;
        }
    }
 </script>


 <select onchange="MM_jumpMenu('window.open()',this,0)" size="1" id="width" name="Width">        
      <option>Select an Option</option>
      <option>Child Plan</option>
      <option value="http://google.co.in">--Google</option>
      <option value="http://www.maxlifeinsurance.com/Plans/insurance-plans/child-insurance/shiksha_plus.aspx">--Shiksha Plus II</option>
      <option value="http://www.maxlifeinsurance.com/Plans/insurance-plans/child-insurance/college-money-back.aspx">--College Plan</option>

     <option>Growth Plan</option>
    <option value="http://www.maxlifeinsurance.com/Plans/insurance-plans/child-insurance/shiksha_plus.aspx">--Flexi Fortune</option>
    <option value="http://www.maxlifeinsurance.com/Plans/insurance-plans/growth/fasttraclplan.aspx">--Fast Track</option>
  </select>

No comments:

Post a Comment