[英]How to get the text of span in javascript when the clientidmode is static of a asp.net page
I am using this 我正在用这个
alert(spanid.innerHTML);
this shows the message undefined. 这显示消息未定义。 why? 为什么?
you should get innerHTML the following way: 您应该通过以下方式获取innerHTML:
var htmlelement = document.getElementById('spanId');
alert( htmlelement.innerHTML);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.