admin 发表于 2024-5-25 17:26:22

jQuery :text 选择器

选择 type="text" 的 <input> 元素:

<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">

$(document).ready(function(){
    $(":text").css("background-color","#B2E0FF");
});

</script>      

</head>
<body>
<html>
<body>

<form action="">
Name: <input type="text" name="user" />
<br />
Password: <input type="password" name="password" />
<br />
<button type="button">Useless Button</button>
<input type="button" value="Another useless button" />
<br />
<input type="reset" value="Reset" />
<input type="submit" value="Submit" />
<br />
</form>

</body>
</html>


</body>
</html>:text 选择器选取类型为 text 的 <input> 元素。

页: [1]
查看完整版本: jQuery :text 选择器