What is javascript onclick event
javascript onclick event occurs when the user click on element .When element gets clicked, javascript onclick function help us to execute the function . This event can be added to any HTML element, such as a button, link, or image.
Supported HTML tag :
It support all HTML tag except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.
Syntax for javascript onclick event :
To add javascript onclick event on an element, we can use the element. onclick property, or the addEventListener() method.