context

英 [?k?ntekst]? ?美 [?kɑ:ntekst]??

n.語境;上下文;背景;環(huán)境

jquery context屬性 語法

作用:context 屬性在 jQuery version 1.10 中被棄用。context 屬性含有被傳遞到 jQuery 的原始上下文,可能是 DOM 節(jié)點(diǎn)上下文,如果未傳遞節(jié)點(diǎn),則是 document 上下文。

語法:context

jquery context屬性 示例

<!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>
運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例