I am encountering an issue with attaching a click event to a button with the class "nextPage". I have provided the code below for reference.
function myContent() {
}
myContent.prototype.clickNext = function() {
alert("clicked");
};
var objMyContent = new myContent();
var el = document.getElementsByClassName('nextPage');
el.onclick=objMyContent.clickNext();
Your insights on where I may have gone wrong would be greatly appreciated. Thank you.