innerHTML changes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • McKirahan

    innerHTML changes

    Why does innerHTML change capitalization and quotation marks?

    If I assign the following tags:

    <span style='backgrou nd-color:yellow'>X </span>

    the following is return via innerHTML:

    <SPAN style="BACKGROU ND-COLOR:yellow">X </SPAN>

    Thanks in advance.


  • McKirahan

    #2
    Re: innerHTML changes

    I just saw that it added a space after the colon so I'll ask ...

    Why does innerHTML change capitalization, quotation marks, and spacing?

    If I assign the following tags:

    <span style='backgrou nd-color:yellow'>X </span>

    the following is return via innerHTML:

    <SPAN style="BACKGROU ND-COLOR: yellow">X</SPAN>

    Thanks in advance.


    Comment

    • Martin Honnen

      #3
      Re: innerHTML changes



      McKirahan wrote:
      [color=blue]
      > I just saw that it added a space after the colon so I'll ask ...
      >
      > Why does innerHTML change capitalization, quotation marks, and spacing?[/color]

      Why not, HTML/SGML rules allow variations, the browser you are using is
      not returning the relevant part of the source markup but is serializing
      the relevant part of the document tree. I agree that it might be nicer
      for some purposes if source formatting were preserved, for other
      purposes it might be nicer if you could set serialization parameters
      like quote characters etc but you will have to live with the different
      ways browser generate innerHTML. If you need a special format you might
      want to write your own serializer traversing the DOM tree.


      --

      Martin Honnen

      Comment

      • Rob B

        #4
        Re: innerHTML changes



        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...