The type variable is not something i am getting from the DOM but something the programmer(me) has to put in. I would do something like this in the code:
to validate the current element on a keyup or some other event. I just want to know how would i access the data inside the textarea. I am basically going to add a case for each type i need to check so i would add a case for textarea, select, radio, etc... The reason i am doing it like this instead of automatically getting what type is if the field is a email field, they can do:
and i will have a case "email" and in there there will be a regex or something to make sure the entered text is a valid email format.