SOURCE

console 命令行工具 X clear

                    
>
console
//定义人类
class Person {
    static county = 12
    constructor(name, sex, brith, address) {
        this.name = name;
        this.sex = sex;
        this.brith = brith;
        this.address = address;
    }
    //坐
    sit() {

    }
    //睡
    sleep() {
        document.getElementById("sleep").innerHTML = `${this.name},23点了,睡觉吧`;
        document.getElementById("sit").innerHTML = `我是个${this.sex}的`;
        return
    }

}

//实例化人类
personA = new Person(name = "lida", '男')

/*=============*/
function aa(){
let title = ["佩洛西窜台是精心策划的挑衅,西方想把‘北约’扩到亚太", "110平方米房子到手仅61平,", "市场监管总局拟规定不得向8周岁以下未成年人销售盲盒"];
for (var index = 0; index < title.length; index++) {
    document.write("<p>" + title[index] + "</p>")
}
}

/*======用JS定义对象=======*/
var car=new Object()
car.color="red";
car.brand="bmw";
car.drive=function(name){
    document.write(name+"车跑起来了")
}

/*======表单=======*/
function check(){
    var name=document.getElementById("username")
    if (name.value!==""){
        console.log(name.value);
        var sex=document.getElementsByTagName("input");
        radiolen=sex.length;
        for(index=0;index<radiolen;index++){
            if (sex[index].check=checked){
            console.log(sex[index])

            }
        }
    }
    else{
    name.fouce
        }
    
    
}
<html>

<head>
	<script>
		/*======用JS定义对象=======*/
var car=new Object()
car.color="red";
car.brand="bmw";
car.drive=function(name){
    document.write(name+"车跑起来了")
}
/*======表单=======*/
function check(){
    var name=document.getElementById("username")
    if (name.value!==""){
        console.log(name.value);
        var sex=document.getElementsByTagName("input");
        radiolen=sex.length;
        for(index=0;index<radiolen;index++){
            
            console.log(sex)

            
        }
    }
    else{
    name.fouce
        }
    
    
}
	</script>
</head>

<body>
	<p>佩洛西窜台是精心策划的挑衅,西方想把‘北约’扩到亚太</p>
	<p id='sit'>110平方米房子到手仅61平,“公摊”刺客比雪糕闹心多了</p>
	<p id="sleep" onclick="car.drive('李琛')">市场监管总局拟规定不得向8周岁以下未成年人销售盲盒</p>
	<div id="insert"></div>
	<form id="oneform">
		<label>用户名:</label><input type="text" id="username"/><br><label>性别:</label>
<input type="radio" name="sex" value="male"><input type="radio" name="sex" value="female"><br>
    <input type="button" value="提交" id="submit" onclick="check()"/>
    </form>
</body>

</html>