Here is some code
var docDiv= document.getElementById("divId");
var dojoDiv= dom.byId("divId");
what are difference between javascript's document.getelementbyid and dojo's dom.byid. which is one more faster. if you want to use dom we need to load dojo.js.
Here is the non IE version of Dojo's dom.byId :
dom.byId = function(id, doc){
// inline'd type check.
// be sure to return null per documentation, to match IE branch.
return ((typeof id == "string") ? (doc || win.doc).getElementById(id) : id) || null; // DOMNode
};
As you will note it uses getElementById.
Hope this answers your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With