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


Groups > comp.lang.javascript > #22656

Re: Reading outerHTML

Message-ID <55605684.RQav8vfDIM@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2014-01-17 16:27 +0100
Subject Re: Reading outerHTML
Newsgroups comp.lang.javascript
References <4ZydnTNcnrnRy0XPnZ2dnUVZ_h6dnZ2d@westnet.com.au>

Show all headers | View raw


Andrew Poulos wrote:

> I have some HTML which is written as
>    <select style="width:80%;"
> 
> When I get the outerHTML of the element in IE9+ and other non-IE
> browsers I get
>    <select style="width:80%;"
> 
> In IE7 and 8 I get
>    <SELECT style="WIDTH:80%;"
> 
> Yet if I do a string replace like
>    el.outerHTML = el.outerHTML.replace("<\/SELECT>", a + "<\/SELECT>");
> It "works" in all browsers except IE9+.

1. There is no question.
2. Your example method call does not relate to your example markup.
3. You have not told the value of “a”.
4. Do not use String.prototype.replace() with HTML unless you know what you
   are doing.
5. Avoid the “outerHTML” property.

<http://PointedEars.de/faq#posting>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

Reading outerHTML Andrew Poulos <ap_prog@hotmail.com> - 2014-01-17 08:58 +1100
  Re: Reading outerHTML "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-17 08:55 +0200
    Re: Reading outerHTML "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-17 11:20 +0100
      Re: Reading outerHTML Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-01-17 12:58 +0000
        Re: Reading outerHTML "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-17 15:44 +0100
      Re: Reading outerHTML Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-17 22:26 +0100
  Re: Reading outerHTML Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-17 16:27 +0100
    Re: Reading outerHTML Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-17 22:21 +0100
      Re: Reading outerHTML Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-17 23:32 +0100
        Re: Reading outerHTML Christoph Michael Becker <cmbecker69@arcor.de> - 2014-01-18 02:02 +0100
          Re: Reading outerHTML "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-18 11:55 +0100
          Re: Reading outerHTML Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-18 12:06 +0100

csiph-web