JavaScript Tip: Using Data Attributes

preview_player
Показать описание
Data attributes let you assign additional data to DOM elements. You can then retrieve and use that data. In this tutorial we look at how to create data attributes and how to retrieve that data using JavaScript.

For more resources on JavaScript:

Tutorials referred to in this video:
Рекомендации по теме
Комментарии
Автор

Great tutorial! The forEach() should use lis_array instead of lis. Array.prototype.forEach() can only apply to arrays, not array-like objects.

liyan
Автор

I finally understand thanks to you thank you🙌

niloofar
Автор

Brilliant, thank you! This is going to make web animation a lot easier

jessicaryan
Автор

Sir you are great . But had a doubt, U converted Node list into array but you didnt use forEach on the new array still it worked ??

nixonnelson
Автор

Curious about first couple of lines in your JS file. They are:
let lis =
let lis_array = Array.from(lis);
You never use the variable lis_array anywhere in your code after that, so why did you define it? I"m working on something now using the data- attribute. I left that second variable out of my code, and it works just fine.

BTW, I love your vids. I'm also taking one of your courses on Udemy.

gbbowler
Автор

Could you pls make video for call bind apply methods?

jainshilpi
Автор

You used the forEach() method on the node list (lis) not the array (lis_array) but your event listeners still worked...?? Update: still works on the node list lol

rogerh
Автор

Thank you sir. So helpful. I must be doing something wrong. Can't get my own code to work. Could I share it with you? Maybe, you'd spot my mistakes. Please.

NedumEze
Автор

Can u please make some video related with javascript datastructure?

jainshilpi
Автор

a bit faster, though, would be greeeeaaaat. cheers.

adicide
Автор

The other day I heard from a c++ coder that web coders are not programmers, or not even developers! Because he asserted web doesn't have logic and algorithms have nothing to do with web! I don't know under which rock he was all these years or in which cave he was been hiding! Anyway, I hope he sees this channel, and comes out of his grave delusion. And choose a photo for channel icon or whatever it is for god sake! It looks darn bad like this!

RameenFallschirmjager