# Alternative method of changing XML attribute?

**URL:** <https://forum.kirupa.com/t/alternative-method-of-changing-xml-attribute/278067>\
**Category:** flash\
**Created:** [December 21, 2008, 4:23pm UTC](https://forum.kirupa.com/t/alternative-method-of-changing-xml-attribute/278067 "2008-12-21T16:23:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankichiro](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@frankichiro](https://forum.kirupa.com/u/frankichiro)\
**Post date:** [December 21, 2008, 4:23pm UTC](https://forum.kirupa.com/t/alternative-method-of-changing-xml-attribute/278067/1 "2008-12-21T16:23:15Z")

</div>

My problem is simple:

[AS]var xml:XML = new XML(’\<p class=“a”\>Whatever\</p\>’);

xml.@class = ‘b’; // 1084: Syntax error: expecting identifier before class.[/AS]

Is there another way to change the attribute?

/ Frank
