File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes document.getElementByID() not working in IE8 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "document.getElementByID() not working in IE8" Watch "document.getElementByID() not working in IE8" New topic
Author

document.getElementByID() not working in IE8

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 190
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 ??
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Do you have more than omen element with that same id value?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Jee Ba
Greenhorn

Joined: Feb 08, 2011
Posts: 7
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

Joined: Sep 01, 2006
Posts: 190


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 >
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
Can you use code tags, so the code is readable?

Eric
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 190
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......



 
 
subject: document.getElementByID() not working in IE8
 
Threads others viewed
How to "enable/disable" radio button in struts2 on click of check box
iframe problem
iframe is not working in IE8
javascript event ?
Problem in getting table cell value in HTML using java script
IntelliJ Java IDE