JQuery: Change Buttons behavior

Sandrac

New Member
I am new to jquery and having issues making a function which does the following.I have table with three rows and four columns each. Inside each column, I have a button with a seperate css for hover effects. The idea of each button is to show their value in a textbox when the button is pressed.I have tried different ways to do the following but have been unsuccessful.[*]Change the css of the pressed button (say change color to red) and make all the other buttons change back to original color (say yellow).[*]add the value of the button in the text box.It is an aspx page so I even tried getting the value by calling the target if of the button. for example:JS:\[code\]//Div Specific Function$("#step1").click(function (e) { var thisID = e.target.ty; $('#input').data('btnType', 'Amount').each(function () { $(this).toggleClass('button'); }) $(thisID).toggleClass('button-hover');});\[/code\]html\[code\]<table cellpadding="10" cellspacing="0" width="90%"> <tr> <td> <input type="button" data-btnType="Amount" id="btn50" runat="server" value="http://stackoverflow.com/questions/15781147/$50" Text="$50" class="button" /> </td> <td> <input type="button" data-btnType="Amount" id="btn100" runat="server" value="http://stackoverflow.com/questions/15781147/$100" Text="$100" class="button" /> </td> <td> <input type="button" data-btnType="Amount" id="btn150" runat="server" Text="$150" value="http://stackoverflow.com/questions/15781147/$150" class="button" /> </td> <td> <input type="button" data-btnType="Amount" id="btn200" runat="server" Text="$200" value="http://stackoverflow.com/questions/15781147/$200" class="button" /> </td> </tr></table>\[/code\]How can I make these buttons act like a radio effect. Please note that there are 10 buttons in all in this div.Regards.
 
Back
Top