Javascript HTML-搜索栏在internet Explorer中不起作用
有人能帮忙吗 我创建了这个搜索栏,它可以在google chrome中使用,但不能在Internet Explorer中使用 如果我按“回车”或单击“搜索”按钮,Internet Explorer中不会发生任何事情 我应该被重定向到一个页面,就像在chrome中发生的那样 有什么建议吗?谢谢大家!Javascript HTML-搜索栏在internet Explorer中不起作用,javascript,html,internet-explorer,search,uisearchbar,Javascript,Html,Internet Explorer,Search,Uisearchbar,有人能帮忙吗 我创建了这个搜索栏,它可以在google chrome中使用,但不能在Internet Explorer中使用 如果我按“回车”或单击“搜索”按钮,Internet Explorer中不会发生任何事情 我应该被重定向到一个页面,就像在chrome中发生的那样 有什么建议吗?谢谢大家! <html> <body> <datalist id="colors"> <option value="Red"> <op
<html>
<body>
<datalist id="colors">
<option value="Red">
<option value="Blue ">
<option value="Green">
<option value="Black">
</datalist>
<input type="hidden" id="color" name="color" value="RED" required>
<input type="hidden" id="color2" name="color2" value="BLUE" required>
<input type="hidden" id="color3" name="color3" value="GREEN" required>
<input type="hidden" id="color4" name="color4" value="BLACK" required>
<form>
<input type="search" list="colors" class="searchbox" id="searchbox" placeholder="What Color?" name="color_repeat" required autocomplete="off"
onsearch="check(this)">
<input type="button" class="button" id="button" value="Search" onclick="check(document.getElementById('searchbox'))">
</form>
<script>
function check(input)
{
if (input.value.toUpperCase() != document.getElementById('color').value)
{
if (input.value.toUpperCase() != document.getElementById('color2').value)
{
if (input.value.toUpperCase() != document.getElementById('color3').value)
{
if (input.value.toUpperCase() != document.getElementById('color4').value)
{
}
else
{
window.top.location.href = 'http://www.color.com.br/BLACK’
}
}
else
{
window.top.location.href = 'http://www.color.com.br/GREEN’
}
}
else
{
window.top.location.href = 'http://www.color.com.br/BLUE’
}
}
else
{
window.top.location.href = 'http://www.color.com.br/BLUE’
}
}
</script>
</body>
</html>
功能检查(输入)
{
if(input.value.toUpperCase()!=document.getElementById('color').value)
{
if(input.value.toUpperCase()!=document.getElementById('color2').value)
{
if(input.value.toUpperCase()!=document.getElementById('color3').value)
{
if(input.value.toUpperCase()!=document.getElementById('color4').value)
{
}
其他的
{
window.top.location.href=http://www.color.com.br/BLACK’
}
}
其他的
{
window.top.location.href=http://www.color.com.br/GREEN’
}
}
其他的
{
window.top.location.href=http://www.color.com.br/BLUE’
}
}
其他的
{
window.top.location.href=http://www.color.com.br/BLUE’
}
}