Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

document.getElementByID() not working in IE8

 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI ,
i am dynamically creating <Select> tag .. and trying to append that to my td element

so i am doing like

var cmpCtl = document.getElementById("my-td"); whre "my-td" is id of td tag

cmpCtl.appendChild(objSelect);

this doesnt work in IE8 it works in IE9 and FF ..


any clue or any other alernative ??
 
Sheriff
Posts: 67620
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
Do you have more than omen element with that same id value?
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe there are some tag that are not closed, like a div or an input. some time ago I have problems with js because of it. All my code worked on Firefox and Chrome, but not in IE. I discovered that I have malformed HTML and it worked again.
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


here is my other function where i am trying to get that TD


i googled it : found related to add TBODY .. is that missing? but on firebug i can see tbody added automatically


i am trying this since last 2 days but no sucess >
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you use code tags, so the code is readable?

Eric
 
ravindra patil
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya Done Eric code is dynamically creating table inside div and use case is i have options under options means like district is option based on selected district need to show city so i am trying to append city options to TD tag
unfortunately its not working in IE8 the code works fine on IE9 ..

i get reference of TD tag but .appendChild not working if i do getElementByName().appendChild it says object doesnt suport this property......



 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic