Jan 13, 2012, 5:35 AM
170 Posts

Change css class on clicked component

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1
 If I have a serverside onclick event how do I change the css class on the object I clicked?
I have tried using this but then all my repeaated images gets this class.  
Jan 15, 2012, 10:43 PM
25 Posts
Re: Change css class on clicked component
 In the client side javascript for the onclick event, take a look at the dojo.replaceClass method. This will replace a classname with another classname. It works really well. However, if you're not on 8.5.3 try dojo.addClass and dojo.removeClass. Once you're done with the class manipulation return true for the client side javascript and then the ssjs will run.