Properties-Properties of jQuery Object Instances

 

一、.context

has been deprecated

 

二、.jquery

請參考Internals的第二項。

 

三、.length

取得jQuery object的數量。

<!DOCTYPE html>
<html>
<head>
    <script src="https://code.jquery.com/jquery-3.0.0.js"></script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
</head>
<body>
    <p>aaa</p>
    <p>bbb</p>
    <p>ccc</p>
    <p>result</p>

    <script>
        $("p:last").text("There are " + $("p").length + " p.");
    </script>
</body>
</html>