预习。

<!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" xml:lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>网页标题</title>
    <meta name="keywords" content="关键字列表" />
    <meta name="description" content="网页描述" />
    <link rel="stylesheet" type="text/css" href="" />
    <style type="text/css"></style>
    <script type="text/javascript">
        //在文本中输入数据的语法
        document.write("<h1>JavaScript</h1>");
        document.write("<p>今天预习了一点点JavaScript的知识,document是对象,.是调用行为的标志,write就是行为,意思就是在document里面write括号里面的内容.</p>");
        //变量的定义、计算
        var a = 10;
        var b = 10*a+a;
        document.write("<font color='red'>if a=10,b=10*a+a;<br />b=");
        document.write(b);
        //弹出警告框
        window.alert("要我教你数学吗?需要请点击确定")
    </script>
</head>
<body>
</body>
</html>

效果图:

posted @ 2016-11-20 23:44  panbee  阅读(104)  评论(1编辑  收藏  举报