js对象的innerHTML属性
<html>
<head>
<scripttype="text/javascript">
functiongetInnerHTML(){
alert(document.getElementById("tr1").innerHTML);
}
</script>
</head>
<body>
<tableborder="1">
<trid="tr1">
<td>Firstname</td><td>Lastname</td>
</tr>
<trid="tr2"><td>Peter</td><td>Griffin</td>
</tr>
</table>
<br/>
<inputtype="button"onclick="getInnerHTML()"value="AlertinnerHTMLoftablerow"/>
</body>
</html>
弹出来的内容是:
<td>Firstname</td><td>Lastname</td>[color=black][/color][/size][size=medium][size=medium][/size][align=left][/align]
相关推荐
WebVincent 2019-11-17
MrWhite0 2015-03-17
srchange 2016-04-26
htmlman0 2019-04-03
DolphinThinker 2019-06-29
kbkiss 2019-06-29
zwq 2016-04-26
WCschool官方 2015-07-20
lzn 2015-06-10
XaverSun 2015-03-17
sunnylinner 2014-12-19
yaoliuwei 2014-09-25
zhangpeng 2014-09-05
来老师 2014-08-10
zhangpeng 2014-05-04
XaverSun 2013-11-15
careyourself 2013-11-15
maozhuofan 2019-06-18