SELECT field SELECT with jquery

0

I'm using the

.find(input[type='text'],input[type='url'],input[type='radio']) , to find form fields in a form.

I would like to search for fields <select>

What is the notation I use in .find() to also search for fields of type <select>?

    
asked by anonymous 09.09.2016 / 14:29

2 answers

1

Add the select to in the list

$.find("input[type='text'],input[type='url'],input[type='radio'], select")
    
09.09.2016 / 14:39
0

For tag search in the DOM via jQuery you just need to add the name of the tag to fetch from jQuery. Example:

$('select').each(function(index, item) {
  alert($(this).find('option').length);
});

The above code will give an alert with the amount of option of each select in DOM

    
09.09.2016 / 15:21