jquery中使用表单元素选择器
2010-09-14 13:08:56 来源:WEB开发网核心提示:[示例代码] <html><head><script src="jquery-1.2.js"></script><script>$(document).ready(function () {$("#form :text"
[示例代码]
<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>
赞助商链接