Monday, December 29, 2008

[jQuery] Modifying an XML document with jQuery

Hi all,
I have define a xml template like this
<group name="jquery">
<member id="001"></member>
</group>

I can use following code to query the template

var memberSection = $(reportxml).find("[id=001]");

but following does not work
// want to add a "name" attribute to the member
$(reportxml).find("[id=001]").attr("name","peter');

Why? Thanks.

No comments: