Day 9 : Quick look at some JS points you may have missed

so, this is different from previous posts. The past week was the first week of me posting any article on the web. Even after not writing everything in detailed form, the response I got was beyond my expectations. From now on, I will try my best to cove…


This content originally appeared on DEV Community and was authored by Gaurav-Shekhawat

so, this is different from previous posts. The past week was the first week of me posting any article on the web. Even after not writing everything in detailed form, the response I got was beyond my expectations. From now on, I will try my best to cover everything in detail..

addEventListener('click', ....) and .onclick are not the same

Yes, they are not the same. The difference being that in the addEventListener , we can add multiple listeners to the same event. While the onclick "overrides" the previous onclick attached to the same event.

For example:- see the below codepen

Please open the above through "edit in codepen" and then see the outputs in the console. I have added enough comments to make you understand everything. In case of any doubt, please do comment.

The full reference about the above point can be found at Medium.


This content originally appeared on DEV Community and was authored by Gaurav-Shekhawat


Print Share Comment Cite Upload Translate Updates
APA

Gaurav-Shekhawat | Sciencx (2021-08-22T06:38:13+00:00) Day 9 : Quick look at some JS points you may have missed. Retrieved from https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/

MLA
" » Day 9 : Quick look at some JS points you may have missed." Gaurav-Shekhawat | Sciencx - Sunday August 22, 2021, https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/
HARVARD
Gaurav-Shekhawat | Sciencx Sunday August 22, 2021 » Day 9 : Quick look at some JS points you may have missed., viewed ,<https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/>
VANCOUVER
Gaurav-Shekhawat | Sciencx - » Day 9 : Quick look at some JS points you may have missed. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/
CHICAGO
" » Day 9 : Quick look at some JS points you may have missed." Gaurav-Shekhawat | Sciencx - Accessed . https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/
IEEE
" » Day 9 : Quick look at some JS points you may have missed." Gaurav-Shekhawat | Sciencx [Online]. Available: https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/. [Accessed: ]
rf:citation
» Day 9 : Quick look at some JS points you may have missed | Gaurav-Shekhawat | Sciencx | https://www.scien.cx/2021/08/22/day-9-quick-look-at-some-js-points-you-may-have-missed/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.