Bug Tracker

Modify

Ticket #4815 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

Doesn't add a class properly

Reported by: mnsanthoshkumar Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

There are 2 cells in a table and 1 has a class defined. I was trying to transfer the class to the other cell with the below code, but it didnt help.

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns=" http://www.w3.org/1999/xhtml" xml:lang="en"> <head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>jQuery</title> <script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> <script type="text/javascript">

$(function() {

$('#up > td').next().addClass('test').end().removeClass('test');

}); </script>

<style> .test {

border:12px red solid;

} </style> </head> <body id="body" class="body">

<table width="100%" border="1">

<tr id="up">

<td class="test">1</td> <td>2</td>

</tr>

</table>

</body>

</html>

Change History

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Your selector is selecting all tds under #up. Please review the jQuery docs and ask questions on the forums.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.