Is there any difference in between the DOM events that  we write in HTML Code like <button onclick="showData">Click</button> and writing in Javascript like querySelector(button).addEventListener(click,showData).
Any information would be appreciated.
 
    