递归出题
This commit is contained in:
63
teaching/jwl/课件/js/localstorage.html
Normal file
63
teaching/jwl/课件/js/localstorage.html
Normal file
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script>
|
||||
// localstorage
|
||||
localStorage.setItem("pwd","123") //添加
|
||||
localStorage.setItem("id","90")
|
||||
let pwd=localStorage.getItem("pwd") //获取
|
||||
// localStorage.removeItem("id") //删除指定
|
||||
localStorage.clear() //删除所有
|
||||
console.log(pwd)
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
文本框<input type="text" value="" id="text"><br>
|
||||
密码框<input type="password" value="" id="pwd"><br>
|
||||
单选框<input type="radio" name="char" value="a">A<input type="radio" name="char" value="b">B<input type="radio" name="char" value="c">C<br>
|
||||
复选框<input type="checkbox" value="1" checked>111<input type="checkbox" value="2" checked>222<input type="checkbox" value="3" checked>333 <br>
|
||||
下拉列表<select name="" id="xia">
|
||||
<option value="1">选项一</option>
|
||||
<option value="2">选项二</option>
|
||||
<option value="3">选项三</option>
|
||||
</select>
|
||||
<button id="sub">获取</button>
|
||||
<p>aaaassxsxs</p>
|
||||
<script>
|
||||
$("#sub").click(function(){
|
||||
var checkedarr=[]
|
||||
// console.log($("#text").val())
|
||||
// console.log($("#pwd").val())
|
||||
// var dan=$("input[type='radio']:checked").val()
|
||||
// console.log(dan)
|
||||
var fu=$("input[type='checkbox']")
|
||||
fu.each(function(){
|
||||
console.log($(this).prop('checked'))
|
||||
checkedarr.push($(this).prop('checked'))
|
||||
})
|
||||
console.log(checkedarr)
|
||||
|
||||
// var xia=$("#xia option:selected").val()
|
||||
// console.log(xia)
|
||||
// $("p").append("Some appended text.");
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
$.ajax({
|
||||
url:"https://kaoshi-shangpin.theluyuan.com/findshop", //地址
|
||||
|
||||
success:function(res){
|
||||
console.log(res)
|
||||
} //接收返回值
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user