Element and Class

2 minutes
Share the link to this page
Copied
  Completed
Select an element that has a specific name and class.

Transcript

Hello, in this jQuery programming video, I am going to show you how to select an element and a class or i mean by that if you only select a particular, you know element from your website from your Dom if it has a certain you know name, so if it's on a certain element type, and it has a certain plot, in this example, I've got this epic class. So I want to click on this printout. Awesome click, I want to say 3.5. Awesome, click 3.5. But if we look, this div has an epic class, this progress on the class and all of these divs have epi class, I want to select this right here. icon selected based on epic class.

Actually, let me get rid of the D. D ID. Okay? So I can't select it based on the class because you'll select any One of these accounts selected based on this class and then the first one, because it would get this one pot selected based on paragraph because it would get, you know, these two I could potentially selected based on paragraph and the first paragraph, but you might not be the first paragraph, you know, I'll just switch around some can't even do that. And what is the solution, we need to select it based on the element name and the class and to do that in really simple, you just put element name which is P dot, the night, make sure there is no space, no space indicate that you are selecting just one element that has to satisfy this condition. And this condition so it needs to be a paragraph or a p tag and it needs to have a class of epi class for soda.

Reload for click element two doesn't do anything for click paragraph one doesn't do anything. Click element. One nothing to free for nothing for free this one however, it detects the click, and it activates this selector code. So that's how you use a selector to be able to detect an element or pick up an element or locate an element and say, based on its name, and having a particular class. So that's it for this video. Thanks for watching, and I look forward to seeing you in the next tutorial.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.