javascript - 在 IE 10 中使用 id 获取值表单文本框

标签 javascript jquery html internet-explorer internet-explorer-10

为了测试,我想检查控制台从文本框设置的值是什么,但 IE 工作正常但 IE 10 无法获取值。

$('#refno').getval;
document.getelementById("refno").value;

enter image description here

最佳答案

在 jquery 中使用 val()

  $('#refno').val();

在 javascript 中

document.getElementById("refno").value;

关于javascript - 在 IE 10 中使用 id 获取值表单文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22808151/

相关文章:

javascript - 设置 window.onresize 时 HTML 元素未调整大小

javascript - 在指令中编译 Controller 时,AngularJS $scope 未定义

javascript - 请求 JSON 的边缘扩展不起作用

c# - 根据值更改颜色

python - Flask 应用程序,按钮刷新浏览器。如何预防呢?

c# - 如何在没有页面重新加载的情况下调用页面方法?

javascript - Angular ui 路由器仅传递来自 $http get 的数据

javascript - 如何在 jQuery 中正确检测移动设备的方向?

jquery - Bootstrap toast 组件无法在数据表上正常工作

html - 垂直对齐因图像而困惑