Play attack animation on mousebutton

How do I play an attack animation on mouseclick?

If(Input.GetMouseButtonDown(0)){

animation.Play("attack");
}