jQuery笔记1--入门1

<!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" />
<script src="../jquery-1.4.2.js" ></script>
<script src="../jquery-1.4.2.min.js" ></script>
<script  type="text/javascript">
    $(function() {
        $("div").css({background:"red"});
    });
</script>
</head>
<body>
    <div>DIV1</div>
    <div>DIV2</div>
    <span>SPAN</span> 
</body>
</html>

 

 1.注意引进js时,不能写成<script src="../jquery-1.4.2.js" />

2.$("div").css({background:"red"});   cs里面是有{}的。

你可能感兴趣的:(JavaScript,html,jquery,css,XHTML)