W
W
Welaurs2017-09-18 18:11:02
HTML
Welaurs, 2017-09-18 18:11:02

jQuery: how to select element by number?

Good evening. There are $('#country'). How to select a specific child option, knowing its number?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rustam Bainazarov, 2019-06-03
@tosster22

The error indicates that only one button, input, meter, output, progress, select, or textarea (your choice) can be inside the label tag.
This is so wrong :

<label>
  <input type="search" class="search-field" placeholder="Поиск по сайту..." value="" name="s">
  <button class="search-submit search__pos"><i class="fa fa-search"></i></button>
</label>

And this is true :
<label>
  <input type="search" class="search-field" placeholder="Поиск по сайту..." value="" name="s">
</label>
<button class="search-submit search__pos"><i class="fa fa-search"></i></button>

A
alvvi, 2017-09-18
@Welaurs

$('#country').children().eq(index);
where index is a number, but you'd better attach the html to be sure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question