添加用户:姓名\电话\email !DOCTYPE html html head meta charsetUTF-8 title/title script function show(){ var show1 document.getElementById(content1);//显示文本的对象 var show2 document.getElementById(content2);//显示文本的对象 var show3 document.getElementById(content3);//显示文本的对象 console.log(show1.value show2.value show3.value); } /*输出到控制台*/ /script style typetext/css button{ margin-left: 250px; height: 20px; width: 120px; } h1{ margin-left: 250px; } /style /head /body h1添加用户/h1 姓名input typetext idcontent1 namecontent/ Email:input typetext idcontent2 namecontent / 电话:input typetext idcontent3 namecontent / br /br / button onClickshow() 添加 /button body /html