javascript来获取带有某些条件的标签下的输入的ID

javascript to get the ID of an input under a label with some conditions

本文关键字:标签 输入 ID 条件 获取 javascript      更新时间:2023-09-26

我只是想寻求一些关于获取输入ID的帮助,即="layout_input_toc16"

在以下条件下过滤:

-label class="current"

-输入type="radio"

-input name="onswipe_options[toc_layout]"

<label class="current">
<input type="radio" name="onswipe_options[toc_layout]" class="option-16; ?>" value="16" id="layout_input_toc16">
<img src="http://cdn.onswipe.com/reader/raw/lay/toc/16/_l-medium.png" alt="16" title=""  width="220" height="165">
<p class="name">Toulouse</p>
</label>

感谢:)

试试这个:

 $('.current input[type="radio"][name="onswipe_options[toc_layout]"]').attr('id');