Myeishamadkins / Myeisha-Madkins-Web-Rental-Agency

FrontEnd Final Project
0 stars 0 forks source link

Mixing jQuery and vanilla JS #2

Open john-terenzio opened 5 years ago

john-terenzio commented 5 years ago

https://github.com/Myeishamadkins/Myeisha-Madkins-Web-Rental-Agency/blob/4cc49c921210162b09f7bcc6dd2c697b7dda1d27/javascript.js#L25

I see you are using jQuery via $ in some place and in others plain JS (ex. addEventListener). It would be best to stick with one approach in your entire file.

natec425 commented 5 years ago

I definitely agree. Unless I'm mistaken, the only places where we should be explicitly using JQuery is when we are trying to interact with some Bootstrap behavior via JQuery.

So $('???').tab('show') would be okay because we are trying to get to .show provided by Bootstrap. But $(...).on(...) should be changed because we would want to use regular querySelector/querySelectorAll and addEventListener.