Jquery Select Problem

Posted by oraclee on Stack Overflow See other posts from Stack Overflow or by oraclee
Published on 2010-05-07T09:02:59Z Indexed on 2010/05/07 9:08 UTC
Read the original article Hit count: 230

Filed under:

Hi;

Jquery Code:

$("[id$=mytable] tr").click(function() {

    alert($(this).html());

});

Html:

<table id="mytable">

    <tr>
      <td class="locked">1</td>
      <td>2</td>
      <td>3</td>      
    </tr>
    <tr>
      <td class="locked">a</td>
      <td>b</td>
      <td>c</td>      
    </tr>      
  </table>

i need only "td class='locked'" click return this

click: <td class="locked">1</td>

output:

<tr>
      <td class="locked">1</td>
      <td>2</td>
      <td>3</td>      
    </tr>

© Stack Overflow or respective owner

Related posts about jQuery