Home>Article>Web Front-end> How to set default value for drop-down box in JS?

How to set default value for drop-down box in JS?

Guanhui
Guanhui Original
2020-06-13 12:00:35 6960browse

How to set default value for drop-down box in JS?

#How to set the default value for the drop-down box in JS?

First create a standard HTML5 document;

     Document 

Then add a drop-down box in the document;

Then introduce jQuery into the page;

Finally write the script tag in the page, and use jQuery in the tag to set the value of the drop-down box to the default value.

Recommended tutorial: "JS Tutorial"

The above is the detailed content of How to set default value for drop-down box in JS?. For more information, please follow other related articles on the PHP Chinese website!

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