Just like in jQuery we can use $(\".classname\"), is there a similar thing in javascript as well? Or if we don\'t have such method then how can i implement that.
Accordi
Yes, you'd have to iterate to support all browsers. If you do, tho, make sure you take advantage of the browser's built in functionality where it exists:
if(document.getElementsByClassName) {
return document.getElementsByClassName(className);
} else {
// iterate
}
Other than that, I'm with Jochen; use a framework