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
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
Share this Question
Share on Google+
5 Replies


acoder
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.      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
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 (tab.style.cursor), not the ID.
Nov 9 '07 #4

P: 27
thanks for the help

-P
Nov 27 '07 #5

acoder
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.