how to change value of a form text field using javascript or rjs

I want to change the value of a text_field under a fields_for when user hit a button. Does anyone know how to do it in javascript or rjs code. Thanks so much!!

never mind. I got it..

Jing Tian wrote in post #965711: