Hello, in this jQuery video, we are going to look at the data method. The data method is used to give information about well data. So if we create a simple div and this div, we're going to say if we're going to DVR and I'm going to play span here, so this is an inline elements of this won't ruin any of the styling that we may have applied div has some natural styling in any way, interfere with that. And I know X amount of years old band, this is where the information is going to go. So instead of you know, Princess supplies or printing our idea here, the multiple sort of selected like, guaranteed concept spans where you know, you can see something, you can dynamically change it within jQuery. So totally change it within jQuery.
So the first thing you should do is do Vol. I would call it dollar 20 to select the elements in this case, this can be the first part and so the first part of the div, then I am going to do dollar data. Data. And now what we are going to do is essentially assign a name to what we're doing here so we can refer to this later on. It's also epic. Come on you long curly braces and go long.
And now we are going to say this was name and a song's name Okay, so now what we need to do is do dollar span one we are going to be Gtech here we go to the donor data give selected appeal. Inside we are going to get it from Epic and we're going to say.net pretty much the exact same thing for last stat. The only difference is the name Save that, reload it with my mask on the live feed. My name is Ron and I am 27 years old. So to prove that it is working, I am going to create the cotton epic proportions. I have no idea when the button is clicked, Darla to pick it up.
So epic. Don't click. We're gonna call this function when it happens. And when it's clicked, we're going to do all this we could fill it to just do this part we're going to do but we're going to do all of it just encapsulated just to separate it out. Just like to see exactly why be triggered when the button is clicked. So fully loaded up Say Miami the letter or click that it puts in.
So that is a great way of sort of, you know, giving information about or their data or their information, providing more context, especially if you're using something like Ajax to you know, get this information from a database is a pretty cool and elegant way of adding it to your dump. That's it simple stuff. If you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.