DOM和BOM、window和document

2020-02-16  本文已影响0人  冉桓彬

记录以下内容

1. BOM和DOM概念
2. window和document概念
3. window.prototype属性
1. BOM和DOM
2. window和document
3. window.prototype
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="点击" onclick="dianJi()">
</body>
<script type="application/javascript">
    function dianJi() {
        window.document.getElementsByName()
        document.getElementsByName();
        alert("点击了");
    }
    function employee(name,job,born) {
        this.name = name;
        this.job = job;
        this.born = born;
    }
    var bill = new employee("Bill Gates", "Engineer", 1985);
    <!--通过prototype向employee对象添加salary属性-->
    employee.prototype.salary = null;
    bill.salary = 20000;
    document.write(bill.salary);
</script>
</html>

参考文章:
https://blog.csdn.net/weixin_44299027/article/details/88930577

上一篇 下一篇

猜你喜欢

热点阅读