On Nov 17, 1:00 pm, Kim wrote:
Quote:
How do I find if an element is a certain element (like
HTMLTableRowElement) ?
The element's - tagName - or - nodeName - properties would seem like a
good place to start (remembering that despite any possible impressions
to the contrary given by the mark-up, the document likely is an HTML
document and so those properties values will be case-normalised to
uppercase).
Quote:
Using "alert(typeof el)" simply displays "object" while
"alert(el)" displays "HTMLTableRowElement".
el = document.getElementById('stringValue');
>
I need to match this specific element because of problems with
"display: none/block" in non-IE browsers.
>
This doesnt work:
if (el == HTMLTableRowElement || el == 'HTMLTableRowElement') {
el.style.display = '';
<snip>
If your CSS and mark-up are such that the above works anywhere (which
would be expected) then it will also work fine on IE. That is, you
don't need to test and branch, you just assign the empty string to the
display property and the display state will revert to its normal/
default value (all else being equal).