jquery评分星星
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#tb td').mouseover(function () {
$('#tb td').text('☆');
$(this).text('★').prevAll('td').text('★');
})
})
</script>
</head>
<body>
<table id="tb" border="1">
<tr>
<td>☆</td>
<td>☆</td>
<td>☆</td>
<td>☆</td>
<td>☆</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<meta charset="utf-8" />
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
$('#tb td').mouseover(function () {
$('#tb td').text('☆');
$(this).text('★').prevAll('td').text('★');
})
})
</script>
</head>
<body>
<table id="tb" border="1">
<tr>
<td>☆</td>
<td>☆</td>
<td>☆</td>
<td>☆</td>
<td>☆</td>
</tr>
</table>
</body>
</html>