views:

53

answers:

1

I am creating a project in Django, and I am using the Django Admin pages along with TinyMCE. But I would like to be able to toggle TinyMCE on and off like in this example:

http://tinymce.moxiecode.com/examples/example_01.php

but since the admin page is generated automatically I imagine I need to overide the base_site.html template which I can do. But my question is "Is there any way I can have something like -- if is textarea ..... -- in javascript?"

Thanks

+4  A: 

You can use

document.getElementsByTagName("textarea")

to return an array of all the <textarea/> elements. Then iterate over it and do with it as you will.

Robusto