Hi,

I've this html section:


<div id="chess-board">
     <div class="chess-board">
     <div id="chess-board_piece_1" class="r" style="position:
absolute; top: 301px; left: 301px;"/>
     <div id="chess-board_piece_2" class="n" style="position:
absolute; top: 301px; left: 258px;"/>
     <div id="chess-board_piece_3" class="b" style="position:
absolute; top: 301px; left: 215px;"/>
     </div>
</div>

I need of a jquery function for get the class ("r", "n","b"), of each
".chess-board div" when I click on it.

I've try this:

jQuery(document).ready(function(){
    $(".chess-board div").click(function() {
    test = $(".chess-board div").attr("class");
    alert(test);
    });
});


Any help?

Alfredo

Reply via email to