N
N
niko832011-09-24 22:21:14
JavaScript
niko83, 2011-09-24 22:21:14

Javascript interaction with custom HTML tags and Namespace?

An HTML document has an extra namespace in it with a "p" tag and an arbitrary "customtag" tag

...<br/>
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:test = &quot;http://example.com/widget/&quot;&gt;<br/>
...<br/>
&lt;test:p&gt;&lt;/test:p&gt;<br/>
&lt;test:customtag&gt;&lt;/test:customtag&gt;<br/>
...<br/>
<br/>
How can Javascript interact with these tags?

For example, the code for inserting a google plus one button looks like this:
&lt;g:plusone&gt;&lt;/g:plusone&gt;
and here is the JS for it apis.google.com/js/plusone.js

Facebook offers a similar code for inserting
&lt;fb:like ref=&quot;top_left&quot;&gt;&lt;/fb:like&gt;<br/>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marcus, 2011-09-24
@niko83

$('test\\:customtag')

T
tick, 2011-09-24
@tick

I remember when IE5 was released it announced support for namespaces and custom tags. It was 1999.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question