Method first and next in jQuery to change color inside a table

  • The next() method allows you to search for the sibling next to the selected element..
  • The first() method allows you to choose the first element within the selected html element.
  • The css() method allows you to apply css properties to the selected element.

Utilization:
$(selector).next().method(...);

$(selector).first().css(...);

Example:

Within a table and its selected columns, we choose the first column and the next column with the next() method, then we apply css properties to that column changing the font color to red.

Comments

PHP Captcha


Interesting Articles