欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery通過closest選擇器修改上級元素的方法

 更新時間:2015年03月17日 10:47:37   作者:上大王  
這篇文章主要介紹了jquery通過closest選擇器修改上級元素的方法,實例分析了jQuery中closest選擇器的使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了jquery通過closest選擇器修改上級元素的方法。分享給大家供大家參考。具體如下:

這段代碼演示了jQuery通過closest選擇器獲取上一級的元素,然后修改其text()內(nèi)容。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> www.dbjr.com.cn </title>
<script type='text/javascript' src='jquery-1.9.1.js'></script>
<script type='text/javascript'>
//<![CDATA[
$(window).load(function(){
var address = $("#jb51").closest("div");
address.text('www.dbjr.com.cn')
});//]]>
</script>
</head>
<body>
<div id="website">
<div id="jb51"></div>
</div>
</body>
</html>

更多關(guān)于jquery選擇器相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jquery選擇器用法總結(jié)

希望本文所述對大家的jQuery程序設計有所幫助。

相關(guān)文章

最新評論