jquery Dom Core

1. DOM Core:

JavaScript 中的getElementById(),getElementsByTagName(),

getAttribute()和setAttribute()等方法,这些都是DOM Core的组成部分


node2:/var/www/html/jquery#cat p1.html 
<html>
 <head>
 <title>dom</title>
 </head>
 <body>
  <p title="选择你最喜欢的水果.">你最喜欢的水果是?</p>
 <ul>
   <li title='苹果' id='aaa'>苹果</li>
   <li title='橘子' id='bbb'>橘子</li>
   <li title='菠萝' id='ccc'>菠萝</li>
   <li title='水蜜桃' id='aaa'>菠萝</li>
  </ul>
  </body>
  </html>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>    
<script type="text/javascript" src="p1.js"></script> 
node2:/var/www/html/jquery#
node2:/var/www/html/jquery#cat p1.js
console.log(document.getElementById('aaa'));
  

原文地址:https://www.cnblogs.com/hzcya1995/p/13348804.html