Good day, the question is solely for educational purposes:

var DomAPICanvas = document.createElement("canvas"); var jQueryCanvas = $("<canvas>"); console.log(DomAPICanvas.constructor); // HTMLElementCanvas function console.log(jQueryCanvas.constructor); // JQuery function 

Actually, I understand perfectly why jQueryCanvas.constructor behaves in this way (chaining), I am interested in the following: is there an opportunity to get the present values ​​of the constructor? And if so, how?

    1 answer 1

    The real value of the constructor can be obtained only with access to the original object / element. ( $("<canvas>")[0] )

    That is, the code will look like this:

     var DomAPICanvas = document.createElement("canvas"); var jQueryCanvas = $("<canvas>"); console.log(DomAPICanvas.constructor); // HTMLElementCanvas function console.log(jQueryCanvas[0].constructor); // HTMLElementCanvas function 
    • or jQueryCanvas.get (0) .constructor - Zowie