javascript - 获取隐藏表单元素的属性值
问题描述
我正在使用 Postman 来自动化一些测试。我需要在名为“执行”的隐藏字段上获取 value 属性的值:
<form class="app-form" method="post" id="fm1" action="login" _lpchecked="1">
<input type="hidden" name="execution" value="633ffc0f">
</form>
在邮递员中,只有 Cheerio 可用于此。我尝试了以下变体,但没有一个有效:
$('input#execution').attr("value");
$('input[name=execution]').attr("value");
$('input[type=hidden]').attr("value");
$(':hidden#execution').attr("value");
$('input:hidden[name=execution]').attr("value");
非常感谢!
解决方案
推荐阅读
- python - 如何使用python从点文件生成sql查询?
- javascript - 日期-fns | 如何格式化为 UTC
- r - 在mapply中将函数名作为参数传递?
- c# - 如何在 while 语句中使用 Console.ReadLine()
- vb.net - 选择关键词之间的文本
- r - R检测下载的zip文件的文件名编码
- django - 如何将 celery 任务订阅到现有的 RabbitMQ 交换?
- powershell - 如何将参数传递给所有纠缠测试脚本
- vue.js - 如何使用 JS Quasar 框架从构建中删除 console.log?
- c# - 条码扫描不允许用户移动条码扫描两次