469,320 Members | 2,140 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,320 developers. It's quick & easy.

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

27
Hi,

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 :

ucId.style.cursor = 'wait';

where ucId is a user control created by vb.net.

Is my sintax ok for IE?

Thanks
Nov 7 '07 #1
5 8295
acoder
16,027 Expert Mod 8TB
The syntax is correct - see link.

How are you referring to this user control element? Do you get any errors?
Nov 8 '07 #2
phfle1
27
here is my function

Expand|Select|Wrap|Line Numbers
  1. function wait(ucId)
  2.   {
  3.      var browser;
  4.      document.body.style.cursor = 'wait';
  5.      var tab = getElementsByID(ucId);
  6.      ucId.syle.cursor = 'wait';
  7. }
  8.  
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
acoder
16,027 Expert Mod 8TB
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 (tab.style.cursor), not the ID.
Nov 9 '07 #4
phfle1
27
thanks for the help

-P
Nov 27 '07 #5
acoder
16,027 Expert Mod 8TB
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.

By using this site, you agree to our Privacy Policy and Terms of Use.