Javascript Jquery选择器选择选项

Javascript Jquery选择器选择选项,javascript,Javascript,我编写了一个代码,基本上选择了所有input[type=“tel”]、input[type=“url”]、select option、textarea元素,如下所示: $(this).find('input[type="text"], input[type="password"], input[type="username"], input[type="email"], input[type="tel"], input[type="url"], select option, textarea'

我编写了一个代码,基本上选择了所有
input[type=“tel”]、input[type=“url”]、select option、textarea
元素,如下所示:

$(this).find('input[type="text"], input[type="password"],
input[type="username"], input[type="email"], input[type="tel"], 
input[type="url"], select option, textarea').each(function(){ 
HTML


CSS
但是
选择选项
不知道。我试过了,但没用

<form>
<input type="text" />
<input type="password" />
<input type="username" />
<input type="email" />
<input type="tel" />
<input type="url"  />
<select>
    <option>a</option>
    <option>b</option>
</select>
<textarea></textarea>
注意:您可以通过某些元素的父元素更改$('body')

返回

<input type="text" />
<input type="password" />
<input type="username" />
<input type="email" />
<input type="tel" />
<input type="url"  />
<option>a</option>
<option>b</option>
<textarea></textarea>

A.
B

你想用它做什么?你能显示示例HTML吗?我想找到一个选择选项。我们有一个代码。就像这样
parent\u fieldset.find
我写的
parent\u fieldset.body.find
一般来说,如果答案包括对代码意图的解释,以及在不介绍其他代码的情况下解决问题的原因,那么答案会更有帮助。
$('body').find('input[type="text"], input[type="password"], input[type="username"], input[type="email"], input[type="tel"], input[type="url"], select option, textarea').each(function(i,e){
    console.log(e)
})
<input type="text" />
<input type="password" />
<input type="username" />
<input type="email" />
<input type="tel" />
<input type="url"  />
<option>a</option>
<option>b</option>
<textarea></textarea>