implemented simple click in JS; took much longer than it should have