I'm using Webform. How can I use JavaScript in it?
You should try Webform conditional module.


  This modules enhances the existing Conditional Rules of the Webform
  Module. It adds the ability to make components dependent on select
  components(i.e. listboxes, radio buttons, and checkboxes) that appear
  on the same page.


Screencast Demo

View a demonstration form