Arnar Birgisson
2008-10-24 14:28:45 UTC
Hi Sander,
need to use "every". You can use forEach instead:
var o = document.getElementsByTagName('input');
forEach(o, addValidFunc);
If you care for using the Selector library you can replace the first line with
var o = $$('input');
cheers,
Arnar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
var o = document.getElementsByTagName('input');
every(o,function(e){addValidFunc(e);return true})
this functions as expected, but I figured there must be a more elegant
way off doing this. I'm feeling very dense that I could not figure it
out by myself. I guess I need to fight my mental block ;)
Since you are explicitly returning "true" for each element, there's noevery(o,function(e){addValidFunc(e);return true})
this functions as expected, but I figured there must be a more elegant
way off doing this. I'm feeling very dense that I could not figure it
out by myself. I guess I need to fight my mental block ;)
need to use "every". You can use forEach instead:
var o = document.getElementsByTagName('input');
forEach(o, addValidFunc);
If you care for using the Selector library you can replace the first line with
var o = $$('input');
cheers,
Arnar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---