Hello, in this jQuery video, I am going to show you the id selector. The id selector, as the name suggests, allows you to select an element based on your something triggering it based on its, you know, particular ID. So this is just a sort of a very generic spaces, like in the code. This is a very generic selector that gets triggered whenever something happens to the div, or any div, which in this case is a click. We want something a bit more specific. So maybe just this particular div to trigger it, you could just do ID or the no call this ID hello world ip 20 hates W. hw two shorter.
So instead of doing div, we can just do hash and then the actual name of the rd so hw was it Can you click, save that? reload? Click second Dave, nothing happened. Click paragraph, not yet nothing happened. Click this page to view is clicked. So this will only ever get triggered when a click event occurs on any element doesn't actually have to be a dip.
So if I were to grab hold of this Correct, yeah. And reload. Now, the hello world doesn't trigger me with a second div before click the paragraph that triggers it. So with any element that has an ID of hate to be. So that's it for selecting elements based on ID. Thanks for watching.
If you have any questions, feel free to shoot me a message and on the 40 new in the next video.