html li标签value属性问题
li标签是有value属性的,但是限制为数字,并且不赞成使用该属性,可以用data-value来代替
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div>
<li data-value="1">1</li>
</div>
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
console.log($("li").data("value"))
</script>
</body>
</html>