Re: Observe field with jquery in Rails 3.1

Robert Walker
Wed, 11 Jan 2012 19:56:20 -0000

Robert Walker wrote in post #1040404:
> $(function() {
>   $(''#fieldset'').click(function() {
alert("Clicked"); });
> });
>
> If this works then you know you''re finding the right HTML element
and
> correctly binding a "click." Once you''ve confirmed this
then try the
> more complex bind syntax.

If you''re using jQuery 1.7+ you might also want to consider using the
new .on()/.off() methods for binding events.

http://api.jquery.com/on/

--
Posted via http://www.ruby-forum.com/.