如果用戶點擊一個按鈕,我如何將其重定向到一個頁面?這是為一個登錄頁面準備的。我已經試過href,但它不起作用。我不知道.php,所以我使用js。
uj5u.com熱心網友回復:
。<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()"/span>> redirect</button>
<script>
function myFunction() {
window.location.href = "http://stackoverflow.com";
</script>>
</body>
</html>/span>
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" class="snippet-box-edit snippet-box-result" frameborder="0"></iframe>
uj5u.com熱心網友回復:
創建一個HTML按鈕,該按鈕 像一個鏈接一樣行事<a href='https://ide.geeksforgeeks.org/'/span>>/span>
<button>
點擊這里
</button> 點擊這里
</a>/span>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/306702.html
標籤:
