Home > Web Front-end > JS Tutorial > js uses a loop to clear the input tag value in a div_javascript skills

js uses a loop to clear the input tag value in a div_javascript skills

WBOY
Release: 2016-05-16 16:34:45
Original
1795 people have browsed it

HTML page

<div class="col-xs-9" id="search_songs_a"> 
<table> 
<tbody> 
<tr> 
<th>钢琴曲名称:</th> 
<td><input type="text" name="info[gqq_name]" id="gqq_name" style="width:200px;"/></td> 
<th style="padding-left:10px;">演奏者:</th> 
<td><input type="text" name="info[gqq_player]" id="gqq_player" style="width:200px;"/></td> 
</tr> 
</tbody> 
</table> 
lt;/div> 

<div class="col-xs-9" id="search_songs_b"> 
<table> 
<tbody> 
<tr> 
<th>属 性:</th> 
<td> 
<span><input type="radio" name="info[gqq_shuxing]" value="不限" checked="checked"/><label>不限</label></span> 
<span><input type="radio" name="info[gqq_shuxing]" value="流行钢琴曲"/><label>流行钢琴曲</label></span> 
<span><input type="radio" name="info[gqq_shuxing]" value="古典钢琴曲"/><label>古典钢琴曲</label></span> 
<span><input type="radio" name="info[gqq_shuxing]" value="爵士钢琴曲"/><label>爵士钢琴曲</label></span> 
<span><input type="radio" name="info[gqq_shuxing]" value="钢琴练习曲"/><label>钢琴练习曲</label></span> 
</td> 
</tr> 
</tbody> 
</table> 
lt;/div>
Copy after login

js page

//清空钢琴曲搜索条件 
function clearsongs() 
{ 
$("#search_songs_a :input").each(function () { 
$(this).val(""); 
}); 
$("input[name='info[gqq_shuxing]'][value='不限']").attr("checked",true); 
}
Copy after login
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