1. 程式人生 > >jquery對象轉化為DOM對象

jquery對象轉化為DOM對象

utf-8 itl html 1.3 title style 操作 query htm

<html>

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-1.11.3.js"></script>
</head>

<body>
<div>元素一</div>
<div>元素二</div>
<div>元素三</div>

<script type="text/javascript">
var $div = $(‘div‘); //jQuery對象
//? div = ?
div.style.color = ‘red‘; //操作dom對象的屬性
</script>

</body>

</html>

jquery對象轉化為DOM對象