Hi,
> $('#englisch').onfocus = function() {
$() accepts IDs, not selectors -- I'm guessing you're coming from
jQuery, which is different.
Also, to hook an event, you're better off using Element#observe[1]
rather than assigning to an attribute.
It's well worth taking an hour or two and reading the Prototype API[2]
from beginning to end. It really only takes an hour or two, and it
will save you a lot more time than that in the long run.
HTH,
--
T.J. Crowder
tj / crowder software / com
www.crowdersoftware.com
On Aug 27, 1:47 pm, "[email protected]"
<[email protected]> wrote:
> Hello,
>
> I need to change content of a dom element on select a option.
> I tried to handel it like this:
>
> <script type="text/javascript">
>
> document.observe("dom:loaded", function() {
> $('#englisch').onfocus = function() {
> $('div').replace('<p>This is English</p>');}
> });
>
> </script>
>
> <select name="select">
> <optgroup>
> <option>Select Language</option>
> <option id="englisch">Englisch</option>
> <option id="german">German</option>
> </optgroup>
>
> But nothing happens.
> Can anyone help me out?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---