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>
posted @ 2018-03-26 19:54  dxm809  阅读(77)  评论(0编辑  收藏  举报