タグ

ブックマーク / please-sleep.cou929.nu (1)

  • jQuery オブジェクトと DOM エレメントの変換

    ジェイクエリーすぐ忘れる DOM エレメント -> jQuery オブジェクト $() 関数に入れてあげれば OK var sample = document.querySelector('#sample'); var jq_obj = $(sample); jQuery オブジェクト -> DOM エレメント jQuery オブジェクトのインデックス 0 らしい var dom_element = jq_obj[0]; 検証 var body = document.querySelector('body'); var jq_obj = $(body); var dom_elm = jq_obj[0]; body === dom_elm // true

    jQuery オブジェクトと DOM エレメントの変換
    reboot_in
    reboot_in 2017/12/03
    “DOM エレメント -> jQuery オブジェクト $() 関数に入れてあげれば OK var sample = document.querySelector('#sample'); var jq_obj = $(sample);”
  • 1