By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,680 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,680 IT Pros & Developers. It's quick & easy.

Display: [object MyXyzElement] instead of: [object HTMLUnknownElement] for <xyz>?

P: n/a
Using this test:

<html>
<body>
<xyz>
<form>
<input type="checkbox" onchange="alert(this);
alert(this.parentNode.previousSibling);">
</form>
</body>
</html>

The two alerts display:

[object HTMLInputElement]
[object HTMLUnknownElement]

How can I define the string to be displayed for <xyz>?
--
C.W.Holeman II | cw***@Julian5Locals.com -5 | http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one's bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks
Apr 1 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
C.W.Holeman II wrote:
Using this test:

<html>
<body>
<xyz>
<form>
<input type="checkbox" onchange="alert(this);
alert(this.parentNode.previousSibling);">
</form>
</body>
</html>

The two alerts display:

[object HTMLInputElement]
[object HTMLUnknownElement]

How can I define the string to be displayed for <xyz>?
<html>
<body>
<div></div>
<form>
<input type="checkbox" onchange="
alert(this);
alert(this.parentNode.previousSibling);
alert(this.parentNode.parentNode.previousSibling); ">
</form>
</body>
</html>
Mick
Apr 2 '07 #2

P: n/a
"Michael White" <mi**@mickweb.comwrote in message
news:46***********************@roadrunner.com...
C.W.Holeman II wrote:
>Using this test:

<html>
<body>
<xyz>
<form>
<input type="checkbox" onchange="alert(this);
alert(this.parentNode.previousSibling);">
</form>
</body>
</html>

The two alerts display:

[object HTMLInputElement]
[object HTMLUnknownElement]

How can I define the string to be displayed for <xyz>?
....
alert(this.parentNode.parentNode.previousSibling); ">
I am looking not for the path to <xyzbut rather how
define the string that is used when this.parentNode.previousSibling
is converted to a string for alert().

--
C.W.Holeman II | cw***@Julian5Locals.com -5 | http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one's bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks

Apr 2 '07 #3

P: n/a
"C.W.Holeman II" <cw***************@yahoo.comwrote in message
news:13************@corp.supernews.com...
"Michael White" <mi**@mickweb.comwrote in message
news:46***********************@roadrunner.com...
>C.W.Holeman II wrote:
>>Using this test:

<html>
<body>
<xyz>
<form>
<input type="checkbox" onchange="alert(this);
alert(this.parentNode.previousSibling);">
</form>
</body>
</html>

The two alerts display:

[object HTMLInputElement]
[object HTMLUnknownElement]

How can I define the string to be displayed for <xyz>?
...
>alert(this.parentNode.parentNode.previousSibling) ;">

I am looking not for the path to <xyzbut rather how
define the string that is used when this.parentNode.previousSibling
is converted to a string for alert().
I do not believe anything is converted to a string. I believe it more or less uses a
predefined text.

Basically, use valid HTML or you are going to get HTMLUnknownElement objects.

-Lost
Apr 3 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.