Home > Web Front-end > HTML Tutorial > Detailed explanation of how to set the default selected options for the tag in HTML
黄舟
Release: 2017-07-28 09:18:47
Original
3455 people have browsed it

There are two methods.

The first method is to set the selected item through the attribute of label is:

var  val = document.all.Item.options[document.all.Item.selectedIndex].text
var  i=document.getElementById( 'sel' ).options[document.getElementById( 'sel' ).selectedIndex].value;
Copy after login

Some other techniques for operating the tag in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template