By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

IE javascript, how to change style of element (works in firefox)

P: 27

I need to change the style of an element and it seems to work fine in FF, but not in IE.

Here's my statement : = 'wait';

where ucId is a user control created by

Is my sintax ok for IE?

Nov 7 '07 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 16,027
The syntax is correct - see link.

How are you referring to this user control element? Do you get any errors?
Nov 8 '07 #2

P: 27
here is my function

Expand|Select|Wrap|Line Numbers
  1. function wait(ucId)
  2.   {
  3.      var browser;
  4. = 'wait';
  5.      var tab = getElementsByID(ucId);
  6.      ucId.syle.cursor = 'wait';
  7. }
on execution, ucId = "ctl00_PlaceHolderMain_usrPageTransactionnelle "

but I get an error : object needed on the line

var tab = getElementsByID(ucId);

Something weird about that is that the ucId is not present in the source of the html page.
Nov 9 '07 #3

Expert Mod 15k+
P: 16,027
First of all, the syntax is incorrect. It should be document.getElementById(ucId). JavaScript is case-sensitive. Note no "s" and D is lower-case.

Secondly, on the last line, you should be using the object (, not the ID.
Nov 9 '07 #4

P: 27
thanks for the help

Nov 27 '07 #5

Expert Mod 15k+
P: 16,027
You're welcome. Glad you got it working.
Nov 27 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.