radio 获取值
HTML:
<span><input type="radio" name="sex" value="man" checked>男</span>
<input type="radio" name="sex" value="woman">女
js:
获取radio值:
$("input[type='radio']").change(function(){
alert($("input[type='radio']:checked").val());
})
alert($("input[type='radio']:checked").val()); //获取选中的radio的值
jquery 替换html:
将<span> 标签替换:replaceWith
$("span").replaceWith("<input type='radio' name='sex' value='man' checked>基佬");
判断平年闰年
function leapyear(year){
if(((year%400==0) || (year%100!=0) ) && (year%4==0))
{
return true;
}
else
{
return false;
}
}
select获取非选中的option:
HTML:
<select>
<option value="" selected="true">-请选择-</option>
<option value="" >-A-</option>
<option value="" >-B-</option>
<select>
JS:
alert($("option:not(:selected)").length)