JavaScript implements the method of clicking the drop down box and choosing to jump to the page directly

  • 2020-06-22 23:53:03
  • OfStack

This article illustrates JavaScript's method of clicking the drop-down box and choosing to jump to the page directly. Share to everybody for everybody reference. Specific implementation methods are as follows:


<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<select name="dgLink2" id="dgLink2" style="WIDTH: 150px" onchange="MM_jumpMenu('parent',this,0)">
 <option value="#"> -- Department of Teaching -- </option>
 <option value="http://kletor.yangtzeu.edu.cn"> Key Laboratory of Petroleum Resources and Exploration Technology, Ministry of Education </option>
 <option value="http://jjxy.yangtzeu.edu.cn"> School of economics </option>
 <option value="http://zf.yangtzeu.edu.cn"> School of Politics and Law </option>
 <option value="http://tyxy.yangtzeu.edu.cn"> Sports institute </option>
 <option value="http://zhongwen.yangtzeu.edu.cn"> College of Arts (Jingchu Culture Research Center) </option>
 <option value="http://yuwei.yangtzeu.edu.cn"> College of Arts (Language Committee, Putonghua Testing Station) </option>
 <option value="http://fl.yangtzeu.edu.cn"> School of Foreign Languages </option>
 <option value="http://art.yangtzeu.edu.cn"> College of art </option>
 <option value="http://shuxue.yangtzeu.edu.cn"> School of Information and Mathematics </option>
 <option value="http://psat.yangtzeu.edu.cn"> College of Physical Science and Technology </option>
 <option value="http://chem.yangtzeu.edu.cn"> School of Chemical and Environmental Engineering </option>
</select>

Hopefully, this article has been helpful in your javascript programming.


Related articles: