Home > Web Front-end > JS Tutorial > body text

Use name to get the select value

php中世界最好的语言
Release: 2018-03-23 09:58:12
Original
2772 people have browsed it

This time I will bring you the precautions for using name to get the select value and the precautions for using name to get the select value. The following is a practical case, let's take a look.

The example is as follows:

<select name="region[province]" id="" class="region valid">
<option value="0" selected="selected" tier="1">省、直辖市</option>
<option tier="1" value="2">北京市</option>
</select>
var province = $("select[name='region[province]']").val();
取得textarea的值
<textarea id=&#39;address&#39;></textarea >
$("#textarea ").val()
Copy after login

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other php Chinese websites related articles!

Recommended reading:

Detailed explanation of code optimization for javascript

CSS3 to achieve tilt and rotation animation effects

The above is the detailed content of Use name to get the select value. 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