Answer the question
In order to leave comments, you need to log in
How to call a class function from a constructor in an object?
Hello. Such situation. There is a class:
class Test {
constructor(Element) {
this.element = Element;
}
static testbind(element_id) {
var element = document.getElementById(element_id);
var text;
element.oninput = function() {
text = element.value;
alert(text);
};
return text;
}
}
testbind()
from the constructor on the object:var ob = new Test(
{
value: /* тут должна быть функция testbind */
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question