js

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="Scripts/jquery-1.7.1.js"></script>
    <script type="text/javascript"> 
        $(function () {
            $("#tab td").mouseover(function () {
                $(this).text('★').prevAll('td').end().nextAll('td').text('★');
            }).mouseout(function () {
                $('#tab td').text('☆');
                $('#tad td[isClicked=true]').text('★').prevAll('td').text('★');
            }).click(function()
            {
                $('tab td').attr('isClicked', true).siblings('td').removeAttr('isClicked');
            });
        });
    </script>
</head>
<body>
<table id="tab">
<tr><td>☆</td><td>☆</td><td>☆</td><td>☆</td></tr>
</table>
</body>
</html>
原文地址:https://www.cnblogs.com/nieyulin123/p/3294385.html