Welcome

首页 / 脚本样式 / jQuery / jquery中使用表单元素选择器

jquery中使用表单元素选择器2011-04-15 csdn博客 胡争辉[示例代码]

<html>
<head>
<script src="jquery-1.2.js"></script>
<script>
$(document).ready(
function () {
$("#form :text").each(
function (index, element) {
$(element).css("background-color", "yellow");
}
);
}
);
</script>
</head>
<body>
<form id="form">
<input type="input" />
<input type="input" />
<input type="input" />
<input type="submit" />
</form>
</body>
</html>