为什么我输出的数字不控制跳转时间呢?没弄明白
web吧
全部回复
仅看楼主
level 2
巴斯 楼主
[勉强]
<!doctype html>
<html>
<head>
<title>第一题</title>
<script>
function load(){
var font1 = document.getElementById("input1").value;
var font2 = document.getElementById("input2").value;
setTimeout(location.href=font1,font2)}
</script>
<style>
</style>
</head>
<body>
<input type="text" value="请在这里输入网址" id=input1>
<input type="text" value="请在这里输入跳转的时间(单位毫秒)" id=input2>
<input type="button" value="提交" id=input2 onClick="load()"/>
</body>
</html>
2019年06月03日 14点06分 1
level 1
反人类代码,id不加引号,value代替placeholder?script写在前面干啥
2019年06月04日 01点06分 2
对不起大佬,老师说过可以不加引号,习惯上加引号,我给忘了,还有那个id我给弄重复了。script,虽说我知道执行的顺序是从上到下,但是我还不太懂,所以就一直习惯写在前面。关于placeholder我还不知道,目前只学了value。谢谢大佬指点。
2019年06月04日 04点06分
@巴斯 建议先去把表单元素的标签和对应的属性看一遍
2019年06月04日 06点06分
1