Get DOM element via class and id selector, using Google Closure

/ Published in: JavaScript
Save to your folder(s)

The Google Closure lets you get DOM elements with getElement( id ) and getElementByClass( class ). This function combines the two to let you get elements similarly to the way jQuery does. E.g. getElement( '#home .sidebar #links') returns the element with an id of 'links', within the element of class 'sidebar', within the element of id 'home'.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.