•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,579 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,749 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 829 | Replies: 2
![]() |
Hi to all, I'm new in the forum and also new in the JavaScript programing.
I have the following problem, I have a table that has another table inside one of its elements, the inside table is affected with one property that is in a CSS file. I hope I explain it OK(here is a piece of the code).
My problem: I need to take the name of the property that is affecting the inside table, I don't know the name of the property(here in the example is 'test'), I need to provide a solution that is dynamic, the name of the property is no always the same(not always 'test').
I was thinking in a solution but I get stuck, I was thinking to take the property of the parent of the object, but also I don't know how many parents my objects has.
I hope you can help me, and I hope I explain my problem OK
I have the following problem, I have a table that has another table inside one of its elements, the inside table is affected with one property that is in a CSS file. I hope I explain it OK(here is a piece of the code).
<body> <table bgcolor="#000000"> <tr> <td valign='top' id='test'> <table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr valign='middle'> <td> <div>This is some text</div> </td> </tr> </table> </td> </tr> </table>
My problem: I need to take the name of the property that is affecting the inside table, I don't know the name of the property(here in the example is 'test'), I need to provide a solution that is dynamic, the name of the property is no always the same(not always 'test').
I was thinking in a solution but I get stuck, I was thinking to take the property of the parent of the object, but also I don't know how many parents my objects has.
I hope you can help me, and I hope I explain my problem OK
•
•
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation:
Rep Power: 0
Solved Threads: 31
hi
plz use right word, coz i m not able to understand u'r problem. here 'test' is not property it is a value of property of td, i.e. id.
so id is an attribute. and for that particular td it has got the value 'test', to set other attribute for that tag u can use
element.setAttribute('attribute_name','value');
function of dom.
if u want to change the style dynamically use function, for ex. font:
element.style.font="value";
or for text-align,
element.style.textAlign="value";
using this u can change style dynamically.
-- to find parent node use
var oParentNode= element.getParentNode();
i hope this info will help u..
plz use right word, coz i m not able to understand u'r problem. here 'test' is not property it is a value of property of td, i.e. id.
so id is an attribute. and for that particular td it has got the value 'test', to set other attribute for that tag u can use
element.setAttribute('attribute_name','value');
function of dom.
if u want to change the style dynamically use function, for ex. font:
element.style.font="value";
or for text-align,
element.style.textAlign="value";
using this u can change style dynamically.
-- to find parent node use
var oParentNode= element.getParentNode();
i hope this info will help u..
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
~Mitch Ratcliffe
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
ajax asp cross-browser javascript menu with few lines of code developer development firefox home html internet javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator microsoft msdn office prevent javascript menu from getting hidden under flash movies site software sql vista web
- Problem with pointers (C++)
- string size problem (C)
- ambigious problem 2nd (C)
- Stack Queue Fstream (C++)
- Simple problem regardingform elements (ASP)
- bridge.dll module missing (Viruses, Spyware and other Nasties)
- problem with VAT and return copmbo box (Visual Basic 4 / 5 / 6)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: border-width Size?
- Next Thread: IE AJAX issue



Linear Mode