Page 1 of 1

change button class on click event

Posted: Sat Feb 01, 2014 11:33 am
by ciccio

I added some css classes in my css asset and i would like to change a button class on a button click event.
i tried to add a js on the button click
codeAppery('mybutton').setAttribute("class","className");/code
but it doesn't work.
how i can do it


change button class on click event

Posted: Sat Feb 01, 2014 11:52 am
by Alena Prykhodko

Hi,

Use this code to add class:
preAppery("mybutton").addClass("className");/pre

To add new class:
preAppery("mybutton").removeClass("className").addClass("New_className");/pre