Re: change width of table with no id or class name...
- From: "Dave Anderson" <NPQRWPDWZGSP@xxxxxxxxxxxxx>
- Date: Thu, 27 Sep 2007 13:58:48 -0500
"swwalsh" wrote:
...not all the tables will have ID's... So how can I get this to work if
a table does not have an id or class...
function showData() {
inputs = document.getElementsByTagName("table");
for (i = 0; i < inputs.length; i++) {
if (inputs[i].width > 500) {
var table = inputs[i].id;
var table2 = document.getElementById(table);
table2.setAttribute("width","400");
}
}
}
Uh...by just using the object reference?
inputs = document.getElementsByTagName("table")
for (i=0; i<inputs.length; i++)
if (inputs[i].width > 500)
inputs[i].setAttribute("width","400")
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use of this email address implies consent to these terms.
.
- Prev by Date: Re: Problem with script that works in IE but not in Firefox
- Next by Date: Re: onclick - reassign new function with parameters after displayed
- Previous by thread: Re: Problem with script that works in IE but not in Firefox
- Next by thread: Re: onclick - reassign new function with parameters after displayed
- Index(es):
Loading