jQuery-少见获取元素的方式

Posted web-zyf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery-少见获取元素的方式相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
</head>
<body>
<p name="test">测试</p>
<script>
$("[name=test]").css("color","red")
</script>
</body>
</html>














以上是关于jQuery-少见获取元素的方式的主要内容,如果未能解决你的问题,请参考以下文章

JQuery元素滚动定位及获取元素的scrollTop,clientHeight,scrollHeight

Jquery 方式获取 iframe Dom元素

如何使用jQuery获取父元素

如何使用jQuery获取父元素

jQuery获取和设置表单元素的方法

jQuery各种获取元素的方式效率比较