I'm new to JavaScript class. I have one JavaScript class. What I want is in console.log
will output result of class object not this element (element that mousedown). How can I write that?
function Transformer (output) {
this.output = output;
$(output+' .object').mousedown(function(e){
console.log(this);
});
}
var test = new Transformer('.console');