jQuery_jqueryのnext()メソッドの使用例

WBOY
リリース: 2016-05-16 16:21:46
オリジナル
1275 人が閲覧しました

この記事の例では、jQuery での next() メソッドの使用法について説明します。皆さんの参考に共有してください。具体的な分析は次のとおりです。

このメソッドは、一致した要素のセット内の各要素のすぐ隣の兄弟要素を取得します。
オプションの式を使用して、兄弟要素のコレクションをフィルター処理することもできます。

文法構造:

コードをコピーします コードは次のとおりです:
$(selector).next(expr)

パラメータリスト:

参数 描述
expr 可选。用于筛选的表达式

Example code:

Example 1:

Copy code The code is as follows:






next() function-Script Home






I am the p element


I am the span element

I am the p element


I am a div element




Set the font color in the elements immediately adjacent to each p element to blue.

Example 2:

Copy code The code is as follows:






next() function-Script Home






I am the p element


I am the span element

I am the p element


I am a div element




Set the font color in the span element immediately adjacent to the p element to blue.

I hope this article will be helpful to everyone’s jQuery programming.

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
最新の問題
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!