I want Element by using class name
Now I am using GWT 2.0
Please help me
Thanks
Use the element. classList. contains() method to check if an element contains a specific class name.
You may also call getElementsByClassName() on any element; it will return only elements which are descendants of the specified root element with the given class name(s).
getElementsByClassName method is to use the for-of loop. We call document. getElementsByClassName with 'slide' to return an HTML element collection object with all the divs. Then we use the for-of loop to loop through each item.
https://developer.mozilla.org/en/DOM/document.getElementsByClassName
e: not supported natively in IE < 9, so you'd have to extend document / make a global function with something like this: http://robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/ or use something like sizzle or jquery - thanks to comments below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With