日期:2014-05-16 浏览次数:20325 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(":radio").click(function() {
//alert($(this).val());
//alert($(this).attr("checked"));
var flag = $(this).attr("checked") == "checked" ? false : "checked";
if(flag == "checked") {
$(this).next().attr("type","text");
} else {
$(this).next().attr("type","hidden");
}
$(this).attr("checked", flag);
})
})
</script>
</head>
<body>
<input name="1" type="radio" value="1" />第一个<input type="hidden" />
<input name="2" type="radio" value="2" />第二个<input type="hidden" />
<input name="3" type="radio" value="3" />第三个<input type="hidden" />
<input name="4" type="radio" value="4" />第四个<input type="hidden" />
<input name="5" type="rad