Added by on 2014-09-15

In this video we’re going to talk about jQuery selectors and I’m going to show you how to select an element on your webpage by its type.
So to do that I’m not been able working with forms because usually form input elements all have an attribute of type and that I pass reset equal to something to determine what gets displayed in the browser
So if I expand this form out you can see that we have three paragraphs each one of these paragraphs has an input elements with type
equal to you something so the first to have a type of text
and the last one has a type of submits… and if we take a look at this in the browser this is pretty much what that form looks like we have a label an input element a label an input element and our submit button okay.
So now we can actually use jQuery to actually select one of these elements by its type and I’m going to select the input elements of type text
First so the way we do that is by opening up our usual dollar sign and parentheses which we used to select elements an insider that I mean at in my quotation marks and here’s where things get a little bit different because in order to select an element by its type we add in a colon and the stoles jQuery….
Okay we’re now going to be selecting all of the elements on a page with a type of whatever we put in here….





Comments are closed.