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://img-blog.csdnimg.cn/20190408182559473.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3poYW95YW5namlhbjcyNA==,size_16,color_FFFFFF,t_70)