javaScript--获取span的值

  • html
<span id="operationType">录入</span>
  • javascript
var V_operationType = document.getElementById("operationType");
console.log(V_operationType.innerText);

运行结果:

 

posted @ 2020-05-03 07:46  codeing123  阅读(1578)  评论(0编辑  收藏  举报