Skip to content
Advertisement

Tag: dataset

javascript data set property

i have set data in the html elements like and try to access them into the js file like: but I got error that says cart.js:5 Uncaught TypeError: Cannot read property ‘action’ of undefined at HTMLButtonElement. Answer If you use this word, you should not use the arrow function!

Reorder select option list using Vanilla JS

Hi I’ve got an option dropdown list with a list of fruit in alphabetical order with some that out of stock. What i’m trying to achieve is moving the out of stock options in the dropdown to the bottom of the list so the in stock items are displayed above those that are out of stock. My idea was to

Advertisement