appendChild Custom HTML tag for IE

R

ryanmhuc

I have a custom HTML tag: <custom>text is here</custom>

I can do anything I would like in terms of calling methods with mozilla
but not IE 6. For instance calling appendChild in IE results in an
error. The innerHTML property is blank even though there is text
between the tag.

Is there a work around for IE. What gives with IE and being able to
access and manipulate custom tags??
 
J

Joshie Surber

Sort of... marking the page up as XHTML then serving the page as
text/xml or application/xml and encoding a basic HTML stylesheet should
do the trick. If you don't include the basic HTML stylesheet, though,
your page will render as a XML tree.

Note that by HTML stylesheet, I am referring to the very basics... ie
b {font-weight:bold} p {display:block} etc...
and marking it as <?xml-stylesheet?>. You should be able to find a HTML
stylesheet several places online. Quite a kludge but it should do what
you want.

It would be better to figure out another way to use the XML tag,
though, such as <span class="custom"> then using a CSS query function
(google for document.getElementsBySelector) to access your tag. That
would fit in better with the HTML specs.
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top