Answers for "jquery from object to queryselector"

1

jquery from object to queryselector

$( "#foo" )[ 0 ]; // Equivalent to document.getElementById( "foo" ) or document.querySelector('#foo')

$( "#foo" ).get( 0 ); // Identical to above, only slower.
Posted by: Guest on October-01-2020
0

queryselector for jquery

var x = $(".yourclass")[0];
console.log('jq' + x);
var y = document.querySelector(".yourclass");
console.log('js' + y);
Posted by: Guest on April-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language