After that, pass an argument with the onClick event function. onClick() event can also run a JavaScript code directly without calling any function. onclick is an HTML attribute. We can also use the addEvenListener() function in order to remove existing click event code or function. Run multiple JavaScript functions onclick. In fact, it is invalid since the second parameter must be a function. The onClick() event is named as click for the addEventListerner(). Only one onclick handler can be assigned to an object at a time. Here we are using the onclick event with the paragraph element. Some HTML elements provides the addEventListener() function in order to add event to the given HTML element. It supports all HTML elements except ,
,