Hello, in this jQuery video, I am going to show you how to get an attribute. One of the use cases for this might be you might have attribute values. And you might need that to stored in a database. For example, getting the JavaScript employed to a normal element, let's say based on a click, for example. So what we are going to do is just create an element on creating a div element. Simple.
I'm going to add a title to it is going to be called hello world. And the template to say, I also save that. Let's get this all in one line there you go to retrieve this particular attribute to get it it's really simple. So let's say if we created the variables involved and we call this time toolbar equals, you need to select your element first. So however you choose to select it, it could be directly just saying div or based on the first element or you know, whatever property doesn't matter. Once you selected it, you do dot ATR for the actual name, title, console dot log, do total wall.
And now if I reload it, as you can see, it is able to get hold of that little piece of code right there. So that's how you get a element Once you've selected it. So any method you use for selecting, let's say you get an attribute in this case is the title. Then you could maybe look at submitted to some back end comes code, save to the database, do some validation on They apply it to a nova element on the page. It's totally up to you. Thanks for watching.
If you have any questions, feel free to drop me a message and I look forward to seeing you in the next video.