How to solve this closure?

the onclick (), that clicks the arrow wants to call oil.prototype.createChart=function (oilRealtable,objId,meteId) {},
Please let me know

Feb.28,2021

<button onclick="createChart(1)">createChart</button>

oilObj.prototype.createChart = createChart = function (a) {
    console.log(a);
}

my idea is to add nodes dynamically, and click on the event to do it with an event delegate.

$().on('click','.glyphicon-eye-open',function(){
    _this.createChart(...);
})
Menu