关于JQuery的一个问题,急急急急!!!!!!!!

 <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <meta charset="utf-8" />
    <script src="scripts/jquery-2.1.4.min.js"></script>
    <script type="text/javascript"> 
        $(function () { alert($("#div1").html()); });
        $(function () { $("#div1").css("background", "red") });
        $(function () { alert($("#div1").css("background")); });    //这行的red为何打印出来是空的
        $(function () { $("#txt").val(new Date()) });
        $(function () { alert($("#txt").val()); });
    </script>
</head>
<body>
    <div id="div1">
        你好呀<font color="red">,朋友</font>
    </div>
    <input type="text" id="txt" />
</body>
</html>

麻烦用代码插入,这么乱怎么看?

<!DOCTYPE html>






<br> $(function () { alert($(&quot;#div1&quot;).html()); });<br> $(function () { $(&quot;#div1&quot;).css(&quot;background&quot;, &quot;red&quot;) });<br> $(function () { alert($(&quot;#div1&quot;).css(&quot;background&quot;)); });<br> $(function () { $(&quot;#txt&quot;).val(new Date()) });<br> $(function () { alert($(&quot;#txt&quot;).val()); });<br>



你好呀,朋友




 <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <meta charset="utf-8" />
    <script src="scripts/jquery-2.1.4.min.js"></script>
    <script type="text/javascript"> 
        $(function () { alert($("#div1").html()); });
        $(function () { $("#div1").css("background", "red") });
        $(function () { alert($("#div1").css("background")); });
        $(function () { $("#txt").val(new Date()) });
        $(function () { alert($("#txt").val()); });
    </script>
</head>
<body>
    <div id="div1">
        你好呀<font color="red">,朋友</font>
    </div>
    <input type="text" id="txt" />
</body>
</html>

代码不清晰,,截图或者用代码片

你要alert($(#div1).css("background**-color**"));

都写在一个$(function(){})里面不好么

jquery库有没有引入。。。。。

 alert($("#div1").css("background-color"));