xml Attribute

JavaScript

$(document).ready(function(){
    var xml =$.parseXML('<root>' + 
                          '<child1 name="Name1" d1="0">' + 
                            '<child2>foo</child2>' +              
                          '</child1>' +            
                          '<hello>no</hello>' +
                      	'</root>');
       d1 = $(xml).find("root>child1").attr("name");
   alert(d1);
   });