1
$( '#mytable button' ).click( function( event ) { 

id like to animate it. so on .click it will do .parents('tr').css('background-color', '#3c3c3c') and stay that color.

Possible? I am new to jquery, still completing classes. Sorry for the dumb question, but its easy points if someone gives me a helpful answer. Maybe point me to a resource that explains how to structure the code when adding multiple actions.

How do I add more? $( '#mytable button' ).click.css(here?)( function( event ) {

Greg L
  • 470
  • 1
  • 6
  • 20

1 Answers1

1

Try this http://jsfiddle.net/qNTda/ or http://jsfiddle.net/qNTda/1/

Hope it fits your need man! Not sure what exactly you are aiming but this will give you good playing ground. lemme know if you need help.

API: http://api.jquery.com/animate/

By the way I reckon by "multiple action" you mean "chaining" read here if you keen: how does jquery chaining work? :)

Code

$('button').click(function () {
    alert($(this).parents().find('table#mytable').html());
    $(this).parents().find('table#mytable').animate({
        backgroundColor: '#3c3c3c'
    });
});
Community
  • 1
  • 1
Tats_innit
  • 33,991
  • 10
  • 71
  • 77