如何將文件鏈接在一起?我的意思是,我該如何創建一個按鈕,點擊後將您帶到另一個網站? (或在我的情況下,閱讀的下一頁)對不起,愚蠢的問題,我是新來的編碼,我只知道基於密碼的按鈕。 :(將文件鏈接在一起
password: <input type=password ID="Next"> <button onclick="correctpassword();">submit</button>
</div>
<script type="text/javascript">
function correctpassword() {
var code = document.getElementById ("Next").value;
// alert ("Haha! I know your password! It's \"" + code + "\"");
if (code == "Next") {
location = "NHD2.html";
} else if (code == "next")
alert ("So Close!!");
else location = "LoginWrongSite2.html";
}
是我。
當你說你想創建一個鏈接按鈕,爲什麼不創建一個純HTML鏈接而不使用JavaScript? '
button
' – Vincent1989DiegoTArgs的回答很好,同樣參見https://stackoverflow.com/questions/2906582/how-to-create-an-html-button-that-acts-like-a-link更多選項 – visibleman