Top Comments
All Comments (14)
-
@RyanVanEtten `delete $0.dataset.event` works for removing.
-
Does the dataset API have a way to delete the attribute, meaning actually remove it like $0.removeAttribute('data-event
') would? -
lapel mic please...thank you
-
Just happened to find this video and followed most of it since I program in jQuery. Not sure how this compares to that. Is this something new that will be in future browsers' javascript interpreters?
-
both matchesSelector and matchMedia i see no usage scenarios for really.
can you provide some, the one you specified didn't really make good sense.
classList i'm already using and i love it
dataset useful maybe but why was it really added for ?
textContent is just confusing when you read about innetText, etc that all nearlt do the same thing :S
-
I see you started to type jQuery there ;)
Really cool stuff seeing this implemented into standard JS, thanks for the video.
-
apple sucks.
-
@STHayden classList, dataset and matchesSelector can be found on caniuse.com. For textContent and matchMedia there are browser compatibility tables on MDN.
Btw for those of you who'd like to know where that stuff is specified:
classList and dataset --> HTMLElement interface --> HTML Living Standard chapter 3.2.2
textContent --> Node interface --> DOM4 chapter 5.2
matchesSelector --> Element interface (extension) --> Selectors API 2 chapter 6.2
window.matchMedia --> Window interface (extension) --> CSSOM View chapter 4
ecmazing 5 months ago 7
@labobo matchesSelector is ideal for event delegation. Also has some unit test uses. matchMedia you can have an event listener bound to when orientation or screensize changes, and you know that event matches when your CSS mq's are switching over. If your styles are using MQs (media queries) then the JS api lets you write behavior that will match.
paulirish 5 months ago