<html>
<script>
function alerts()
{
alert(document.getElementById('wb').value);
}
</script>

<body>
<input type="text" >
</body>
</html>

 

执行上述的代码发现,浏览器值读了第一个值,而不会读取第二个值.

 

所以不要在同一个页面用不唯一的id,很容易出错.

 

相关文章:

  • 2022-12-23
  • 2021-05-25
  • 2021-12-22
  • 2021-07-05
  • 2022-12-23
  • 2021-07-24
  • 2021-09-14
  • 2021-05-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案