$('li a').click(function(e) {
e.preventDefault();
$('a').removeClass('active');
$(this).addClass('active');
});
for following simple menu?If you want to use jquery-like syntax, have a look at Dquery.
The Dart way is probably to do something like (I'm on my phone, so excuse syntax errors):
querySelectorAll('a li').forEach(ListElement li){
If (shouldBeActive)
li.classes.add('active');
else
li.classes.clear(); // or try remove as well if you don't want to clear
}
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Forgot to add li.onClick.listen(e){....}