Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tend to build all my DOM in object oriented javascript, and always give the root element of a UI component the same class name as the name of the JavaScript class. See eg https://github.com/marcuswestin/Focus/blob/master/js/ui/pane.... The CSS selectors then mirror the structure of thr JavaScript files as well as the hierarchy of the resulting UI.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: