This box is red because it has the class "redclass".
We've also set up a style for the class "yelclass".
Click the button to switch to that style.
The box should then turn yellow and gain a thick blue border.
:ClassjqSwitchClassSimple: MiPageSample
⍝ Control:: _JQ.jqSwitchClass _html.head
⍝ Description:: Interchange classes during callback
∇ Compose;box:Access public
Use'JQueryUI' ⍝ because we will add a jQuery UI effect later Add_.styleScriptFollows
⍝ .redclass {background-color:red; border:15px solid transparent;}
⍝ .yelclass {background-color:yellow; border:15px solid blue; } box←'#output''.redclass'Add_.div(WrapFollowing'p')
⍝ This box is red because it has the class "redclass".
⍝
⍝ We've also set up a style for the class "yelclass".
⍝
⍝ Click the button to switch to that style.
⍝
⍝ The box should then turn yellow and gain a thick blue border. ('#button'box.Add_.Button'Repaint').On'click''Repaint''onclick="window.location.reload()"'box.Add_.Button'Reload'
∇
∇ r←Repaint:Access public
⍝ Scripts belong in the <head> element: r←'head'AppendNew_.jqSwitchClass('#output''redclass''yelclass'800'easeInOutCirc')
∇
:EndClass