html弹出一个输入框提示用户输入姓名

html-css05

html弹出一个输入框提示用户输入姓名,第1张

1、首先打开html编辑器,新建一个html文件,例如:index.html。

2、在index.html中的<body>标签中,输入以下html代码:

<input type="text" placeholder="请输入账号" />

<input type="password" placeholder="请输入密码" />

3、浏览器运行index.html页面,此时的输入框有了提示文字“请输入账号”,密码框有了提示文字“请输入密码”。

html中弹出框可以用window.open方法

<html>

<head>

<script type="text/javascript">

function open_win() 

{

window.open("需要弹框的地址")

}

</script>

</head>

<body>

<input type=button value="Open Window" onclick="open_win()" />

</body>

</html>

定义和用法

open() 方法用于打开一个新的浏览器窗口或查找一个已命名的窗口。