[英]redirect to url entered in text box
我希望它重定向到單擊“取消阻止”時在文本框中輸入的URL。
................................................... .........................
<center>
</font>
<input size="40" onkeypress="return searchKeyPress(event);" name="getId" type="text" id="getId" style="background-color: black;
border: 2px;
border-style: double;
border-color: white;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-weight: bold;
margin: 4px 2px;
cursor:;" placeholder="Enter website URL here" />
<button style="background-color: black;
border: 2px;
border-style: solid;
border-color: white;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-weight: bold;
margin: 4px 2px;
cursor: pointer;"id="btnUnblock" onclick="createLink()">Unblock</button>
</center>
嘗試這個:
function createLink()
{
var value_input = document.getElementById('getId').value;
window.location.href = value_input;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.