Skip to content

Instantly share code, notes, and snippets.

@chingovan
Created May 16, 2016 14:46
Show Gist options
  • Save chingovan/98a786b977000f479e567894ada91e22 to your computer and use it in GitHub Desktop.
Save chingovan/98a786b977000f479e567894ada91e22 to your computer and use it in GitHub Desktop.
<%@include file="/html/auinode/init.jsp"%>
<aui:row>
<aui:row>
<input type="text" id="textColor" value=""/>
</aui:row>
<aui:row>
<aui:col span="3">
<input type="button" id="redButton" value="Red"/>
</aui:col>
<aui:col span="3">
<input type="button" id="blueButton" value="Blue"/>
</aui:col>
<aui:col span="3">
<input type="button" id="yellowButton" value="Yellow"/>
</aui:col>
<aui:col span="3">
<input type="button" id="resetButton" value="Reset"/>
</aui:col>
</aui:row>
</aui:row>
<aui:script>
AUI().use('aui-node', function(A){
var text = A.one('#textColor');
var redBtn = A.one('#redButton');
var blueBtn = A.one('#blueButton');
var yellowBtn = A.one('#yellowButton');
var resetBtn = A.one('#resetButton');
redBtn.on(
'click', function(){
text.removeClass('blue');
text.removeClass('yellow');
text.addClass('red');
}
);
blueBtn.on(
'click', function(){
text.removeClass('red');
text.removeClass('yellow');
text.addClass('blue');
}
);
yellowBtn.on(
'click', function(){
text.removeClass('blue');
text.removeClass('red');
text.addClass('yellow');
}
);
resetBtn.on(
'click', function(){
text.removeClass('blue');
text.removeClass('yellow');
text.removeClass('red');
}
);
});
</aui:script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment