【发布时间】:2011-07-20 22:16:34
【问题描述】:
有没有办法为 xml 响应中的标签的一部分赋予不同的 css 类? 换句话说,现在的标签值是
label: $( "name", this ).text() + ", " + ( $.trim( $( "countryName", this ).text() ) || "(unknown country)" ) + ", " + $( "countryCode", this ).text()
我希望只给 $( "countryCode", this ).text() 一个不同的 css 类,因为我希望它的字体必须比其他字体小(name 和 countryName)
有办法吗?
success: function( xmlResponse ) {
var data = $( "geoname", xmlResponse ).map(function() {
return {
value: $( "name", this ).text()
,
label: $( "name", this ).text() + ", " +
( $.trim( $( "countryName", this ).text() ) || "(unknown country)" ) + ", " +
$( "countryCode", this ).text()
,
id: $( "geonameId", this ).text()
};
}).get();
【问题讨论】:
标签: jquery css xml user-interface autocomplete