jQuery #idセレクター

❮jQueryセレクター

IDが「intro」の要素を選択します。

$("#intro")

定義と使用法

#idセレクターは、特定のIDを持つ要素を選択します。

idは、HTML要素のid属性を参照します。

注: id属性は、ドキュメント内で一意である必要があります。

注: id属性を数字で開始しないでください。一部のブラウザで問題が発生する可能性があります。


構文

$("#id")

Parameter Description
id Required. Specifies the id of the element to select

❮jQueryセレクター