1.
var hash={
"百度" :"http://www.baidu.com/",
"Google" :"http://www.google.com/",
"微软" :"http://www.microsoft.com/",
"武林网" :"//www.VeVB.COm/"
};
function showUrl(element){ //使用哈稀对象
alert(hash[element.value])
}
</script>
</head>
<body>
<form>
<input type="text" id="txt" />
<input type="button" value="测试" onclick="showUrl(document.getElementById('txt'));"/>
</form>
</body>
</html>
新闻热点
疑难解答