Selector
Returns the original selector passed to jquery ().
In other words, it returns what selector you use to find this element. Can be used with the context for precise detection of selector queries. These two properties are useful for plug-in developers.
HTML section:
<body>
<ul>
</ul>
</body>
JS section:
$ (function () {
$ ("ul")
. Append ("<li>" + $ ("ul"). Selector + "</li>")
. Append ("<li>" + $ ("ul Li"). Selector + "</li>")
. Append ("<li>" + $ ("Div#foo ul:not ([class])"). Selector + "</li>");
});
Context
Returns the original DOM node content passed to jquery (), which is the second parameter of jquery (). If not specified, then the context points to the current document.
Can be used with selector for precise detection of selector queries. These two properties are useful for plug-in developers.
HTML section:
<body>
<ul>
</ul>
</body>
JS section:
$ (function () {
$ ("ul")
. Append ("<li>" + $ ("ul"). Context + "</li>")
. Append ("<li>" + $ ("ul", Document.body). Context.nodename + "</li>");
});
"Technology" jquery's Selector & context