[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

how to switch between two class attribute of tr using javascript without page refresh

Hi,
On a javascript on click validation, i have to toggle a field(remove or add) in JSP, where as if i remove a field, then i have to assign a value for the class attribute <tr class="roll1"> or if i add i have assign another value. <tr class="roll2">. i have to do this without refresh.
0
rakztech
Asked:
rakztech
1 Solution
 
Saber37886661Commented:
when looping through the tables rows just set the items cssName.

check here for more info
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_21531143.html

let me know if that doesnt help and u need the code done for you

0
 
Michel PlungjanIT ExpertCommented:
if the validation is serverside you will need to look into ajax
0
 
Gurvinder Pal SinghCommented:
you can change the classname of an element (td, tr etc) using javascript like this
document.getElementById('tr1').className = 'roll2';

0
 
rakztechAuthor Commented:
solution was helpful
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now