Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2009
    Posts
    121
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How can I change class of all inputs by rowid(FormsRow) using Jquery?

    How can I remove all inputs class from "Button" and assign "BigButton" class to all inputs by rowid(FormsRow) using Jquery. My table has 20 rows but I only want to change the following row's inputs tag's class:

    Code:
    <tr name="" id="FormsRow">
    <td name="" id="" colspan="2"><input type="button" value="1st Letter" class="Button"></td>
    <td name="" id="" colspan="2"><input type="button" value="2nd Letter" class="Button"></td>
    </tr>
    Thanks

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,391
    Thanks
    11
    Thanked 568 Times in 561 Posts
    Code:
    $('#FormsRow input').removeClass('Button').addClass('BigButton');

  • Users who have thanked devnull69 for this post:

    asifakhtar (09-19-2012)

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,608
    Thanks
    6
    Thanked 997 Times in 970 Posts
    By the way: name is not a valid attribute for table rows and cells, and the ID attribute must not be empty.

  • #4
    Regular Coder
    Join Date
    Feb 2009
    Posts
    121
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Thanks. It works.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •