jquery context attribute


  Translation results:

context

UK [ˈkɒntekst] US [ˈkɑ:ntekst]

n.Context; context; background; environment

jquery context attributesyntax

Function: The context attribute was deprecated in jQuery version 1.10. The context property contains the original context passed to jQuery, which may be the DOM node context, or the document context if no node is passed.

Grammar: context

jquery context attributeexample

<!DOCTYPE html>
<html>
<head>
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("div").append("<p>" + $("div").context + "</p>").append("<p>" + $("div",document.body).context.nodeName + "</p>");
}); 
</script>
</head>
<body>

<span>Context: <div></div></span>
<span><b>注释:</b>context 属性在 jQuery 版本 1.10 中被弃用。</span> 

</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Popular Recommendations

Home

Videos

Q&A