a dozen.5 Populate target that have DOM node references according to params and you will get back target

a dozen.5 Populate target that have DOM node references according to params and you will get back target

The fresh new params factor passed so you can dom(), then onto the getOrMakeDom() varies regarding the sort of parameter which can be enacted. Similar to jQuery the latest type’s of value’s introduced is going to be one among the many following:

The result of passage params is the design regarding a cycle-in a position target that contains references in order to nodes (e

  • css selector string (age.grams. dom(‘body’))
  • html string (e.g. dom(‘

    Hellow

    Community!

    ‘))

  • Ability node (e.grams. dom(document.body))
  • selection of ability nodes (elizabeth.grams. dom([document.body]))
  • a good NodeList (elizabeth.grams. dom(file.looks.children))
  • a beneficial HTMLcollection (e.grams. dom(document.all))
  • a beneficial dom() object itself. (e.g. dom(dom()))

g. <0:ELEMENT_NODE,1:ELEMENT_NODE,length:2>) either in the DOM or in a document fragment. Lets examine how each of the above parameters can be used to produce an object containing node references.

The fresh new reasoning permitting particularly a wide variety of parameter items is shown below on the code and you can starts with an easy evaluate to confirm one params isn’t undefined, an empty sequence, otherwise a set which have blank areas. Continue reading a dozen.5 Populate target that have DOM node references according to params and you will get back target