dom - Create a classList substitute for the browsers that haven't implemented it yet -


there's question looks 1 here:
create own classlist object when browser not implement itself
problem answer works in browsers not work in ie7 , in flock (at least).
i'd have alternative works these browsers.
want simple believe it's not simple implement.
want able apply code browser build time ie7 or ff 3.0 build:

var select = document.createelement('select'); select.classlist.add('guestselect'); 

how can accomplish that?
note don't want use frameworks or libraries. want 1 write code!
i'd way specially because want learn how accomplish these kinds of things.

maybe don't need answer anymore, other may still looking it.

since ie7 doesn't implement element class, can't extend prototype. best can create own element class wraps dom elements, , use everywhere. that's frameworks do, way.

mind you, dramatically change code you've written. that's why it's better (simpler?) rely on global functions addclass(element, "foo");.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -