# Problem about javascript in RoR

**URL:** <https://www.ruby-forum.com/t/problem-about-javascript-in-ror/114438>\
**Category:** Rails\
**Created:** [September 12, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/problem-about-javascript-in-ror/114438 "2007-09-12T18:32:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlphaEleven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8491ac/32.png) [@AlphaEleven](https://www.ruby-forum.com/u/AlphaEleven)\
**Post date:** [September 12, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/problem-about-javascript-in-ror/114438/1 "2007-09-12T18:32:27Z")

</div>

The problem is that if i want to change the value of a html element  
like textfield in the function in controller, how can i get that?

example:

def  
…  
#like following  
\<javascript tag change the element’s value\>

end

---

<div class="post-metadata">

**Author:** ![AlphaEleven](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8491ac/32.png) [@AlphaEleven](https://www.ruby-forum.com/u/AlphaEleven)\
**Post date:** [September 13, 2007, 4:36am UTC](https://www.ruby-forum.com/t/problem-about-javascript-in-ror/114438/2 "2007-09-13T04:36:52Z")

</div>

Try

page[‘id\_of\_element’].value = “new value”

Ivor
