What is the difference jQuery objects acquired dom dom objects and native

js native acquired dom is an object, an array is a collection of jQuery object array object, in fact, selected elements, so that they are two different types of objects are not equivalent

  • Native DOM objects turn jQuery object

    var box = document.getElementById('box')
    var $box = $(box)
  • jQuery objects go native DOM object

    var $box = $('#box')
    var box = $box[0]

Guess you like

Origin www.cnblogs.com/0x29a/p/11240888.html