Javascript 如何从$(';form';)[…]获取$(';input[name=…]';).val();

Javascript 如何从$(';form';)[…]获取$(';input[name=…]';).val();,javascript,jquery,Javascript,Jquery,这是我的html代码 <div id="list_refer_1"> <form id="refer_1_0"> <input type="hidden" name="channel" value="1"> <input type="hidden" name="url" id="input_1_0" value="http://localhost:8000/"> <input type="button

这是我的html代码

<div id="list_refer_1">
   <form id="refer_1_0">
      <input type="hidden" name="channel" value="1">
      <input type="hidden" name="url" id="input_1_0" value="http://localhost:8000/">
      <input type="button" onclick="pullrefer(1, 0);" value=" -  "> 
      http://localhost:8000/ 
   </form>
   <form id="refer_1_xxxxx">   ///xxxxx is timestamp
      <input type="hidden" name="channel" value="1">
      <input type="hidden" name="url" id="input_1_1" value="http://127.0.0.1:8000/">
      <input type="button" onclick="pullrefer(1, 1);" value=" -  "> 
      http://127.0.0.1:8000/ 
   </form>
   <form id="refer_1_2">
      <input type="hidden" name="channel" value="1">
      <input type="hidden" name="url" id="input_1_2" value="http://localhost*">
      <input type="button" onclick="pullrefer(1, 2);" value=" -  "> 
      http://localhost* 
   </form>
   ...
但我想得到

$('input[name=url]').val() from $('#list_refer_1 **form**')**[1]**;
如何得到它? 谢谢。

使用选择器(它是基于零的)

使用选择器(它是基于零的)


@未定义,请不要在没有重要原因的情况下编辑帖子。。(值是一个属性值。可以是一个不带引号的单词或带引号的字符串。)@未定义,请不要在没有重要原因的情况下编辑帖子。。(值是属性值。可以是不带引号的单个单词或带引号的字符串。)
$('input[name=url]').val() from $('#list_refer_1 **form**')**[1]**;
$('#list_refer_1 form:eq(1) input[name=url]').val();