按钮标签无法跳转网页是什么原因?

来源:2-8 基本控件(2)

卑微小郝

2020-11-20 18:21:51

按钮标签无法跳转网页是什么原因?
〈div〉
〈P〉
〈input type="button" value="我是一个普通按钮"〉
〈/P〉
〈P〉
〈input type="submit" value="提交表单"〉
〈/P〉
〈P〉
〈input type="reset" value="重置按钮"〉
〈/P〉
〈/div〉

写回答

1回答

好帮手慕言

2020-11-20

同学你好,需要把同学写的代码放在form标签中

http://img.mukewang.com/climg/5fb7a20f09e3af7a04540106.jpg

<input type="button" value="我是一个普通按钮">定义可点击的按钮,不会跳转,下方两个按钮是可以跳转的,同学可以测试下。

http://img.mukewang.com/climg/5fb7a27c09ede9f504790060.jpg

http://img.mukewang.com/climg/5fb7a28209aa53ff05460056.jpg

可以使用下方代码测试下

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="tijiao.php" method="POST">
        <p>
            <button>我是一个普通按钮</button>
        </p>
        <p>
            <input type="button" value="我是一个普通按钮">
        </p>
        <p>
            <input type="submit" value="提交表单">
        </p>
    </form>
</body>

</html>

祝学习愉快~

1

0 学习 · 15276 问题

查看课程