标签:style io os ar strong for sp cti on
select值获取方式
<select id="areaId" name="areaId" onchange="chooseEvent()" style="width:100px">
<option classna="world" value="0"> 世界 </option>
#foreach($item in $areaList)
<option value="$item.id" classna="$item.className">
$item.name
</option>
#end
</select>
var select=$("#areaId")[0];
var data1=select.item(select.selectedIndex).getAttribute("classna");
var n_id=$("#areaId").val();
当用户从若干给定的的选择中选取其一时,就会用到单选框。
<form><input type="radio" name="sex" value="male" />
Male <br /><input type="radio" name="sex" value="female" />
Female </form>
js取值方式:
$("input[name=‘user‘]:checked").val();
当用户需要从若干给定的选择中选取一个或若干选项时,就会用到复选框。
<form><input type="checkbox" name="bike" />
I have a bike <br /><input type="checkbox" name="car" />
I have a car </form>
<form name="input" action="/html/html_form_action.asp" method="get">
Male:
<input type="radio" name="Sex" value="Male" checked="checked">
<br />
Female:
<input type="radio" name="Sex" value="Female">
<br />
<input type ="submit" value ="Submit">
</form>
标签:style io os ar strong for sp cti on
原文地址:http://www.cnblogs.com/l-woniu/p/3992280.html