• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getElementsByClassName

 
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright I was looking around for what browsers supported this method and everywhere I looked it says it supports it at 9 but not earlier. I'm using 10 and trying to use document.getElementsByClassName('someClassName') and I'm getting errors saying that this method isn't supported by the object. I know for a fact from viewing the html page that the classes were included correctly so why the..... let's go with heck.... isn't it working? Thanks in advance for any helpful input.

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't have a good answer for you because I've used jQuery for so many years and it factors all this nonsense away. I assume that there is some reason you cannot use jQuery in your environment?

If I have a chance later today I'll do some research on this method.
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There could be three reasons .
1) Case- Sensitivity
2) Document object is corrupted by assigning it to some other variable.
3) Any error in the code prior to it.

Apart from that I can see IE10 supporting getElementsByClassName.

 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your web page have an incorrect DOCTYPE declaration? Or are you viewing the page on an intranet server? In either case it's possible IE has decided to switch into compatibility view, effectively IE7, so none of the more modern features would be available.
 
reply
    Bookmark Topic Watch Topic
  • New Topic