Append somewhere. Try it Yourself ». We can do this by using a form and a submit button but there is no point in using a form for a hyper linking of pages. id). Javascript has a built-in click() function that can perform a click in code. Either we can call them by mentioning their names with element where onclick event occurs or first call a single function and all the other functions are called inside that function. function myFunction () {. Creating button object: The button object can be created using JavaScript. document.getElementByld("btnClick").onClick=clickEvent; A function contains some code that will be executed by an event or a call tothat function. Tip: Always specify the type attribute for a