我有一行下拉列表网址重定向的代码,工作正常我需要在新标签中打开网址,我做了一些搜索,发现window.location的替代方法是窗口。开放,但所以我把代码更改为我认为合乎逻辑的但我知道某些事情不对,但我目前没有解决它的知识。
$(function () {
// get your select element and listen for a change event on it
$('#selectEl').change(function () {
// set the window's location property to the value of the option the user has selected
//window.location = $(this).val();
window.open($(this).val(););
});
});
HTNL
<form name="form1">
<select name="select" size="1" id="selectEl">
<option value="">I would like to login to...</option>
<option value="client_login">Secure Login</option>
<option value="https://login.xero.com/">Xero Login</option>
<option value="https://secure.saasu.com/a/login">Saasu Login</option>
<option value="https://businessaccounting.banklinkonline.com">BankLink Login</option>
</select>
</form>