innerText

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 5     <title>test1</title>
 6 </head>
 7 <body>
 8     <div id="content">
 9         <p>This isa a <strong>paragraph</strong> with a list following it.</p>
10         <ul>
11             <li>Item 1</li>
12             <li>Item 2</li>
13             <li>Item 3</li>
14         </ul>
15     </div>
16     <script type="text/javascript" src="test1.js"></script>
17 </body>
18 </html>
1 var content = document.getElementById("content").innerText.toLowerCase();
2 console.log(content);
3 var content = document.getElementById("content");
4 content.innerHTML = "Hello world!!!";
5 console.log(content.innerText);
posted @ 2012-05-12 21:39  小猩猩君  阅读(860)  评论(0编辑  收藏  举报