当前博客:Jquery选择器-表单选择器

200 次浏览【转载需注明来源】

博客作者:【临界点】

个性签名:寒窗苦读十年一朝凤舞九天

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <form id="myform" name="myform" method="post" action=""></form>
  <input type="hidden" name="uno" value="9999" disabled="disabled" />
  姓名:<input type="text" id="uname" name="uname" /><br>
  密码:<input type="password" id="upwd" name="upwd" value="123456" /><br>
  年龄:<input type="radio" name="upwd" value="0" checked="checked" />小屁孩
  <input type="radio" name="upwd" value="1" />你懂得<br>
  爱好:<input type="checkbox" name="ufav" value="篮球" />篮球
  <input type="checkbox" name="ufav" value="爬床" />爬床
  <input type="checkbox" name="ufav" value="代码" />代码<br>
  来自:<select name="ufrom" id="ufrom">
    <option value="1" selected="selected">请选择</option>
    <option value="0">北京</option>
    <option value="1">上海</option>
  </select><br>
  简介:<textarea name="uintro" id="" cols="30" rows="10"></textarea><br>
  头像:<input type="file" name="" id=""><br>
  <input type="image" src="http://www/baidu/com/img/bd_logo1.png" width="20" height="20" name="" id="">
  <button type="submit" onclick="return checkForm()">提交</button>
  <button type="reset">重置</button>
</body>

</html>
<script src="jquery-3.7.1.js"></script>
<script>
  /* 表单选择器 */
  var inputs = $(":input")
  console.log(inputs)
</script>

Jquery选择器-表单选择器