Home >Web Front-end >HTML Tutorial >css simulation implements select drop-down box_html/css_WEB-ITnose

css simulation implements select drop-down box_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:56:191021browse





下拉框




请选择


<script><br> var $$ = function (id) {<br> return document.getElementById(id);<br>}<br>window.onload = function () {<br> var btnSelect = $$("btn_select");<br> var curSelect = btnSelect.getElementsByTagName("span")[0];<br> var oSelect = btnSelect.getElementsByTagName("select")[0];<br> var aOption = btnSelect.getElementsByTagName("option");<br> oSelect.onchange = function () {<br> var text=oSelect.options[oSelect.selectedIndex].text;<br> curSelect.innerHTML = text;<br> }<br>}<br></script>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn