i'm new to prototype. i was using jQuery and loved it and am a little
confused coming over to prototype. i am trying to add and remove a
class of active to a labels parent div. does anyone know why i can't
do this?

i've tried this

<div id="submit-choices'>

<div>
<input /><label>my label</label>
</div>

<div>
<input /><label>my label</label>
</div>
</div><!-- close submit-choices div -->

  Event.addBehavior({
    '#submit-choices label:click' : function() {
        removeClassName($('submit-choices div'), 'active');
        this.addClassNAme('active')
      }
    }
  })

and also

  Event.addBehavior({
    '#submit-choices label:click' : function() {
      var divs = document.getElementById('submit-
choices').getElementsByTagName('div');
      if ( divs.hasClassName('active' )) {
        divs.removeClassName('active');
        this.addClassNAme('active')
      }
    }
  })

it keeps saying divs.hasClassName is not a function. i mean wtf?

--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to