i have legacy js code which i dont what to touch defined in script A.js .. it have simple onlick event and function attahced to it
$(document).ready(function () {
//jquery onclick
$("#create_button").click(function (e) {
.....
}
}
//html
<button class="btn btn-primary" id="create_button"
name="create_button">
Create New app
</button>
Then to add functionality to this button im defining in doing this is loading in my second script script B.js which comes after A.js
$(window).on('load', function(){
document.getElementById("create_button").addEventListener("click", () => {
self.MyFirstFunction()
}, false);
}
my question is how can i defined that self.MyFirstFunction() will allways triggred first ?