Use JavaScript to Save Current Cell Data?

I want to use the JS tools to save the current cell’s value from cell index 1 when a button in pressed in cell index 2. Anyone able to explain how I can accomplish this? Thank you!