使用JavaScript填充表格值
我使用JavaScript代码填充此值。之后,我可以在宇宙中看到这个值。但是在框中看不到价值。因此,我无法单击“提交”按钮。此元素在表单标签中。图像链接 https://i.sstatic.net/quz8f.png https://i.sstatic.net/r9kgx.jpg
function myfn(){
document.getElementsByName("ELEC_CURR_B_PHASE").value="415V";
var x= document.getElementsByName("ELEC_CURR_B_PHASE").value="415V";
console.log(x);
};myfn()
i am filling this value using javascript code. after that i am able to see this value in cosole. but value not visible in box. due to this i am unable to click submit button.this element is in a form tag.images link
https://i.sstatic.net/quZ8f.png
https://i.sstatic.net/r9KgX.jpg
function myfn(){
document.getElementsByName("ELEC_CURR_B_PHASE").value="415V";
var x= document.getElementsByName("ELEC_CURR_B_PHASE").value="415V";
console.log(x);
};myfn()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
getElementsbyname()
返回节点符并设置属性值,请选择第一个索引。getElementsByName()
returns a NodeList and to set the property value, select the first index.