How to trigger animation in character by clicking on guitext

Im am makin an app. that if user click on guitext (Dance) then animation triggers in character…Pleas tell me Thankyou

should be…

function OnGUI() {

if( GUI.Button(Rect(10, 10, 130, 30), "Dance")) {

animation.Play();
}

}