writeAttribute() example

The documentation on http://prototypejs.org/api/element/writeAttribute is a wee bit scarce. So here’s a quick one on usage.

To add an attribute:

To remove an attribute:

To enable all disabled form elements (in a form with the id ‘container’):

2 thoughts on “writeAttribute() example”

  1. Thank you so much! For the life of me, I cannot understand why the documentation at the official Prototype website is so poor. Their explanation about practically everything (not just writeAttribute) seems so short and cryptic. It’s almost like they’re trying their best to hide what Prototype can do. Weird!

    It’s such a pity because from my limited experience coding with Prototype so far, it seems like a great framework.

    1. I’m glad that this has been of use.

      It annoyed me 3 years ago.
      Since then, I’ve found jQuery to be a much more usable framework.

      Happy coding 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *