Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30646

Re: Then xmlns attribute in the XHTML DOM

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Then xmlns attribute in the XHTML DOM
Date 2016-06-07 20:29 +0200
Organization PointedEars Software (PES)
Message-ID <2430820.NM7pdxVHKh@PointedEars.de> (permalink)
References <xmlns-20160607025524@ram.dialup.fu-berlin.de>

Show all headers | View raw


Stefan Ram wrote:

> span = document.createElement( 'span' );
> span.setAttribute( "xmlns", "http://www.w3.org/1999/xhtml" );
> document.getElementById( "example" ).appendChild( span );
>  
>   , or
> 
> span = document.createElementNS( "http://www.w3.org/1999/xhtml", "span" );
> document.getElementById( "example" ).appendChild( span )
> 
>   , or even just
> 
> span = document.createElement( 'span' );
> document.getElementById( "example" ).appendChild( span )
> 
>   . Which of these three approaches is correct?

The latter two.

>   Especially, I'd like to know whether the last one, the one
>   that does no mention »w3.org«, already is correct.)

It is:

<https://www.w3.org/TR/2015/REC-dom-20151119/#dom-document-createelement>

Next time, RTFSpec.  (It is not the first time that you should have done 
that before you posted.)

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next | Find similar | Unroll thread


Thread

Re: Then xmlns attribute in the XHTML DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-07 20:29 +0200

csiph-web