Hi Ross, you can use document.getElementsByClassName() but the real question is, why are you accessing the DOM directly if you're using Vue?
You shouldn't need it usually, but maybe you're... porting an app?
ps. #ama is a tag for people that are supposed to hold Ask me anything, a form of public forum in which a person with a particular walk of life answers questions by people. I would change your tags to #help #vue #javascript for example
This. 99.9% you shouldn't touch the DOM manually, Vue being data driven is how you should always approach your app. Set the values in data and initialise the plugin with that data.
That said, if you do need to access an element, the simplest "Vue way" to do it is by using $refs
Hi Ross, you can use document.getElementsByClassName() but the real question is, why are you accessing the DOM directly if you're using Vue?
You shouldn't need it usually, but maybe you're... porting an app?
ps. #ama is a tag for people that are supposed to hold Ask me anything, a form of public forum in which a person with a particular walk of life answers questions by people. I would change your tags to #help #vue #javascript for example
This. 99.9% you shouldn't touch the DOM manually, Vue being data driven is how you should always approach your app. Set the values in data and initialise the plugin with that data.
That said, if you do need to access an element, the simplest "Vue way" to do it is by using $refs
Wait a second you sparked something there for me thank you
doh sorry,
I am accessing the dom to bind dates to date picker, and preselected values for lists