复制代码 代码如下:
var $xml = $("<aa><bb para=\"bbpara\">bbtext</bb> <cc> cctext </cc><cc>789798</cc>aatext</aa>");
function log(o){
$("textarea").val($("textarea").val()+"\n"+o);
}
log($xml.text());
log($xml.html());
log($xml.children("cc").html());
log($xml.children("bb").attr("para"));
log("each");
$xml.find("cc").each(function(){
log($(this).text());
});
时间: 2024-10-26 06:33:48