Re:Vue.js is easier to learn than jQuery
by kisstheblade on Sunday October 30, 2016 @08:35AM
(#12829442)
Well if they come from a web design background they know the css selectors which work with jquery.
Unlike your example, which doesn't work as written.
Probably doesn't work because document.getElementById doesn't work with a CSS #id selector as a parameter, it needs the bare id, so it isn't finding the increment or output elements.
Re:Vue.js is easier to learn than jQuery
by LukasSkywalker on Sunday October 30, 2016 @09:17AM
(#12829616)
You can always use document.querySelector() to target elements using a css selector
Re:Vue.js is easier to learn than jQuery
by the_duke on Sunday October 30, 2016 @02:30PM
(#12831405)
Whoops yeah, I just pasted from their jQuery code and forgot to remove the #. Remove them and it works: https://jsfiddle.net/wqxxufkv/
But as Skywalker mentioned, node.querySelector() / querySelectorAll has been working well across browsers for a while and supports most expressions jQuery selectors would.
That's kind of ridiculous though.
No one should be writing anything for the web without a basic understanding of how the DOM works, even if you wrap things like jQuery, vue.js or React around it.
It's not that complicated.
Every beginners tutorial should start with a basic introduction to the DOM, with some examples, and without ANY libraries.
Using jQuery here is pointless.
Here, without jQuery. How is using jQuery here with a beginner of ANY help?