Select parent

Description

The following code shows how to select parent with parent selector $("td:parent").

Example


<html>
<head>
<script
  src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {<!--from w w  w. j ava  2s.  c om-->
    $("td:parent").fadeTo(1500, 0.3);
  });
</script>
</head>
<body>
  <table border="1">
    <tr>
      <td>Value 1</td>
      <td></td>
    </tr>
    <tr>
      <td>Value 2</td>
      <td></td>
    </tr>
  </table>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities