How to define long methods
I have this fiddle
http://jsfiddle.net/kQ8aS/
This is the jquery code
- $(document).ready(function (){
- $('tr:first-child').next().addClass("current");
- $("#next").click(function(){
- $("table").find('.current').removeClass("current");
- });
- });
In my code,i am giving the second child a pink highlight and pushing the highlight to the next element when next is clicked.
I am doing that by removing the current class from the previous element and adding a current class to the next class.
How do i express that thought in one statement
so far i have
- $("table").find('.current').removeClass("current");