Search code examples
jquerydojo

what is dojo equivalent of jquery's $(this) or $(JavaScript object)?


$(this) or $(JavaScript object) returns a javascript object wrapped in jquery object, hence making it a jquery object, which gives it additional functionalities?

What is its dojo's equivalent


Solution

  • Dojo doesn't have a wrapper for objects as far as I know of. It has a wrapper for DOM nodes:

    require([ "dojo/query" ], function(query) {
        query(document.getElementById("test")); // Adds extra features
    });
    

    You can then add extra features by importing one of these modules:

    • dojo/NodeList-dom
    • dojo/NodeList-data
    • dojo/NodeList-traverse
    • dojo/NodeList-manipulate
    • dojo/NodeList-fx
    • dojo/NodeList-html

    There are probably equivalents in Dojo for the additional functionalities you want, but then you will have to give more information about which functionalities you really need.