用来返回某个html标签内的文本内容。
例如:
<span id=span1>abc</span>
<input type=button value="show innerText" onclick="alert(span1.innerText)">对应的,还有innerHTML属性,是返回标签内的html代码。用法类似。
例如:
<span id=span1>abc</span>
<input type=button value="show innerText" onclick="alert(span1.innerText)">对应的,还有innerHTML属性,是返回标签内的html代码。用法类似。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货