Object doesn't support this property - getElementByID sylevisibility ?

J

jc

I have a tbody tag inside a table. The page was generated by
sharepoint and there is a lot of parentNode nesting.


I'm trying this javascript code

document.getElementByID('tbodytest').style.visibility = 'hidden';

and getting

Object doesn't support this property

If I set the style visibility property on the html markup directly it
works.

Is the issue that's it's not finding the tag?


I've tried finding it like this too with no luck.

getField('TBODY','tbodytest').style.visibility='hidden';

function getField(fieldType,fieldTitle) {
var docTags = document.getElementsByTagName(fieldType);
for (var i=0; i < docTags.length; i++) {
alert(docTags.title);
if (docTags.title == fieldTitle) {
return docTags
}
}
}

Thanks for any help or information.
 
J

jc

BTW -

These result in a blank alert ..

alert(document.getElementsByTagName('tbody')[0].getAttribute("id"));
alert(document.getElementsByTagName('tbody')[1].getAttribute("id"));

Also, is it true that style visibility property might be read-only
from javascript for TBODY . My TBODY is inside a table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top