1. Test code:
1 <!DOCTYPE HTML>2 3 <HTML>4 5 <styletype= "Text/css">6 <!--7 8 -9 </style>Ten One <Scripttype= "Text/javascript" > A <!-- - - the window.onload= function() - { - varidText01=document.getElementById ("idText01"); - Console.log (idText01); + Console.log (idtext01.innertext); - Console.log (idtext01.innerhtml); + Console.log (idtext01.textcontent); A Console.log ("* * *"); at /*For (ZZ in idText01) - { - Console.log (ZZ); - } - //*/ - }; in - - to </Script> + - the <svgwidth= "+"Height= "$"ViewBox= "0 0"xmlns= "Http://www.w3.org/2000/svg"Xmlns:xlink= "Http://www.w3.org/1999/xlink"Xmlns:cge= "http://iec.ch/TC57/2005/SVG-schema#"Xmlns:hzsvg= "Http://holleygrid.cn/svg"> * $ Panax Notoginseng <textID= "idText01"font-size= "+"font-family= "SimSun"Stroke= "RGB (98, 157)"Stroke-width= "0.106666666666667"x= "0.6288"y= "30.9472" >Pd</text> - the </svg> + A </HTML>
2.
2.1, IE9 inside, Svgtextelement no innerText and InnerHTML attribute, use is textcontent
2.2, Chrome (version 49.0.2623.87 m) inside, there are InnerHTML and textcontent, no InnerText
3.
It seems that it's better to use attribute textcontent.
4.
5.
<text/>