473,386 Members | 1,715 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,386 software developers and data experts.

change a class of an object at runtime

Hello,
I am creating a table cell on runtime.
I want to change the style, so it will look and react like a button.
(style = "border-style: outset").

1) How can I create a button or any element on a cell ?
2) How can I change the style behaviour of a cell ?
3) Can I change the class-name of the cell on runtime ?

Thanks :)
Jul 23 '05 #1
4 12130
On Sun, 21 Nov 2004 19:35:33 +0200, Eitan wrote:
I want to change the style, so it will look and react like a button.


Why not blow the expense and use an actual button?

BTW - alt.html.dhtml, comp.lang.javascript,
microsoft.public.scripting.jscript,
microsoft.public.scripting.vbscript

...is far too wide a cross-post for this question.
Follow-Ups set to c.l.js.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #2
Well, with regard to question 3), the following javascript works for
me:
document.getElementById('theButton').className = "newClassName";

Jul 23 '05 #3
Eitan wrote:
Hello,
I am creating a table cell on runtime.
I want to change the style, so it will look and react like a button.
(style = "border-style: outset").

1) How can I create a button or any element on a cell ?
element.style.borderStyle="outset" (I've never heard of this style)

2) How can I change the style behaviour of a cell ?
See above
3) Can I change the class-name of the cell on runtime ?

element.className="yourClassName"

Mick
Jul 23 '05 #4
On Sun, 21 Nov 2004 18:04:53 GMT, Mick White
<mw***********@rochester.rr.com> wrote:

[snip]
element.style.borderStyle="outset" (I've never heard of this style)


It's a standard style, defined in both CSS 1 and 2:
<URL:http://www.w3.org/TR/REC-CSS2/box.html#border-style-properties>.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5

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

Similar topics

10
by: Dan | last post by:
All I Am Attempting To Serialize An Object To An XML File. Here Is The Code For That public string SaveNewSurvey( MutualSurveyObject mso_TempObject, int i_JobID ) { string s_RootFileName;...
8
by: Richard Bell | last post by:
I have a class in a seperate dll which I want to remote. I have referenced the class and registered it using a simple exe. I can connect to the class's interface using Activator.GetObject and call...
7
by: yufufi | last post by:
lets say we have a 'shape' class which doesn't implement IComparable interface.. compiler doesn't give you error for the lines below.. shape b= new shape(); IComparable h; h=(IComparable)b;...
3
by: User N | last post by:
Perhaps this is a stupid question, but here goes anyway. Given an instance of an arbitrary class, is it possible to change its base class at runtime? Here's my problem... I need to extend...
3
by: Andy | last post by:
If I use Visual Studio.Net 2003 to generate "web references" for clients using either sproxy.exe (for C++) client or wsdl.exe (for C#) clients, the web service endpoint gets "baked" into the...
8
by: Radek Budař | last post by:
Hi all, i have trouble with changing text value of textbox on runtime. I use this control to display process information about sending e-mail per smtp. I use external component >>Imports...
0
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
5
by: Joseph Barillari | last post by:
Hi python-list, I've just started using new-style classes and am a bit confused as to why I can't seem to alter methods with special names (__call__, etc.) of new-style class instances. In other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.