Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
    <head>
        <style>
        .hover {
            background-color: #CCF;
        }
        </style>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" charset="utf-8">
            $(function() {
                $('#refEl').on('mouseover', 'thead label', function() {
                    $(this).toggleClass('hover');
                });
            });
        </script>
    </head>
    <body>
    <p>The header of this table <strong>should</strong> trigger the event.</p>
    <table>
        <thead>
            <tr>
                <td>
                    <div id="refEl">
                        <table border="1">
                            <thead>
                                <tr>
                                    <th><label>Header A</label></th>
                                    <th><label>Header B</label></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><label>this element should<br /> not trigger event</label></td>
                                    <td><label>this element should<br /> not trigger event</label></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </td>
            </tr>
        </thead>
    </table>
        
    </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x