4 Replies Latest reply on Nov 23, 2015 12:37 PM by KuddRoww

    add bold text to XML paragraph element

    KuddRoww Level 1

      I'm trying to get the following output:

      <book><p>hello now <bold>brown</bold> cow</p></book>

       

      This is what I have:

      var tagRoot = new XML("<book>");

      tagRoot[0].p[0] = "hello now";

      tagRoot[0].p[0].bold = "brown";

      tagRoot[0].p[0] += " cow";

      alert(tagRoot)

       

      For some reason it turns the brackets from the bold tag into HTML entities.

       

      How do I get the above output?

       

      Thanks,

       

      Kurtis