473,396 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Other method to access style property?

Hi,

Due to a restriction on the host, I'm not allowed to use .style, so I'm
unable to manipulate the style property of the element. Is there any
other way to get to style without using something like
getElementById(id).style ? Is there any method sorta like
getElementById(id).getStyle ? Thanks much.

Jul 23 '05 #1
2 1150
On 02/05/2005 09:44, ta*******@gmail.com wrote:
Due to a restriction on the host, I'm not allowed to use .style [...]


Are you not allowed to manipulate the style object, or just not allowed
to use '.style', literally. If it's the latter, then use square bracket
notation:

obj['style']

If you cannot manipulate the style object, you will not be able to alter
the inline style of the element. However, you could change the class
attribute:

obj.className = 'new-style';

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
> Are you not allowed to manipulate the style object, or just not
allowed
to use '.style', literally. If it's the latter, then use square bracket notation:

obj['style']
That's exactly what I needed. Thanks much, Mike. I was thinking of
using the square brackets and somehow, I drifted away from actually
playing with it (well, the effect of late night I guess).
If you cannot manipulate the style object, you will not be able to alter the inline style of the element. However, you could change the class
attribute:

obj.className = 'new-style';

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christopher Jeris | last post by:
Please help me understand the differences, in semantics, browser support and moral preferredness, between the following three methods of swapping content in and out of a page via JavaScript. I...
5
by: Andrew Poulos | last post by:
If I have an external stylesheet that is @imported into my page and it has an element that looks like this: * html td { font-style: italic; } how can I use javascript to change the font...
12
by: Andy Jeffries | last post by:
Hi all, I want to write a function that given two elements will make their heights equal to the larger element. I've had a go at it and it works, but it makes both their heights larger than...
8
by: GTi | last post by:
I have a UI Class with StatusBarPanels Then I have another Class that is a thread. I want this class thread to update the StatusBarPanels in the UI class. But I get the error: error CS0120: An...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
2
by: Henri | last post by:
Hi! consider this : <div runat="server" id="mydiv" style="color:white;width:200px;" /> the styles contained in the style attributes are automatically parsed to the Style property. Is there a...
3
by: L.C. Rees | last post by:
Can custom __setattr__ methods and properties be mixed in new style classes? I experimented with a new style class with both a custom __setattr__ method and a property. Attributes controlled by...
5
by: John Dolinka | last post by:
I am trying to change a tooltip on an asp.net (framework 2) textbox with out a post back to the server. I can access many of the textbox properties and change them but not the tooltip. Below is a...
9
by: bonk | last post by:
Does anyone have a simple example on how to prohibit that any thread other than the current thread modifies a certain object (a collection) while we are in a certain section of the code? In other...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.