Home > front end >  How does ability let the drop-down, jump to the corresponding url ah, hurry
How does ability let the drop-down, jump to the corresponding url ah, hurry

Time:10-08

Just to learn HTML, how does ability let the drop-down, jump to the corresponding url!




<meta HTTP - equiv="content-type" Content="text/HTML. Charset=gb2312 "/& gt;
No title documents & lt;/title> <br/></head> <br/><br/><body> <br/><The form id="form1" name="form1" method="post" action="" & gt; <br/><Label> <br/><Select the name="select" & gt; <br/><The option value="https://bbs.csdn.net/topics/www.sywebsoft.com" & gt; www.sywebsoft.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.024linghang.com" & gt; www.024linghang.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.baidu.com" & gt; www.baidu.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.sina.com" & gt; www.sina.com</option> <br/></select> <br/></label> <br/></form> <br/></body> <br/></html><p class="article - content rp"> CodePudding user response: </p>Monitor drop-down box to choose events, in the event of an choice to obtain the value of the option, and then to jump! <br/><Select the name="select" onchange="func ()" & gt; <br/><The option value="https://bbs.csdn.net/topics/www.sywebsoft.com" & gt; www.sywebsoft.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.024linghang.com" & gt; www.024linghang.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.baidu.com" & gt; www.baidu.com</option> <br/><The option value="https://bbs.csdn.net/topics/www.sina.com" & gt; www.sina.com</option> <br/><br/>The function func () {<br/>//get the chosen option tag <br/>Var vs=$(' the select option: selected). Val (); <br/>Window. The location. Hrem=v; <br/>}<p class="article - content rp"> CodePudding user response: </p>Thinking: <br/>1. Give a drop-down box binding change event, listening to the select box. <br/>2. Listen to the corresponding value value. <br/>3. To get the value value location.href=https://bbs.csdn.net/topics/directly to get the corresponding value </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/57294.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/57294.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/57293.html'>Gitbook can also set the navigation bar?</a></div> <div class="detail-arr-right">Next:<a href='/frontend/57295.html'>HTML this page write js, cannot be achieved</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=HTML+%28CSS%29' target='_blank'>HTML (CSS)</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul><li><a href="/Backend/56546.html">Dizzy dead, hurry by a C implementation of recursive binary </a></li><li><a href="/other/55492.html">Hurry to download a four points, four points who sent an ah.</a></li><li><a href="/Backend/55198.html">Hurry and run time login box out of the question</a></li><li><a href="/Softwareengineering/55078.html">Simulation site data submitted, with what method hurry up? U</a></li><li><a href="/database/54506.html">Hurry asked in a table with an SQL statement, please find ou</a></li><li><a href="/frontend/51057.html">Hurry to, for encryption of cracking</a></li><li><a href="/database/48963.html">Shell script regularly archive logs, hurry hurry hurry.</a></li><li><a href="/database/46158.html">Alerted to hurry for the socket</a></li><li><a href="/database/45171.html">PB player to come in to help ah, hurry, the drop-down menu.</a></li><li><a href="/Backend/44901.html">Delphi xe3 BusinessSkinForm 10.31 Ribbon use problem, who ha</a></li> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>