I am learning javascript and using RightJS. What is the difference between the following?
var thing = $('thing1')
and
var thing = document.getElementById('thing1')
I am learning javascript and using RightJS. What is the difference between the following?
var thing = $('thing1')
and
var thing = document.getElementById('thing1')
Copyright © 2021 Jogjafile Inc.
Type it into the browser's console
You can see the $ returns some sort of wrapped object and that getElementById returns an Html Node.
Check out their docs on Util.$