<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>2-2.element 选择器(寻找铅笔)</title>
<script src="../js/jquery-1.6.4.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
alert($("#default").val());
//$("#default").hide(); //用来判定是否找到了该标签。
$("div#divtest").attr("edi","30"); //改行添加了一个属性//<div edi = "30" id = "divtest">div的内容</div>
$("div").css("background-color","red");
});
</script>
</head>
<body>
<div id="divtest">div的内容</div>
<div id="default" value = "123456">1234</div>
</body>
</html>