$('#'+street)[0].className="current"; //一定要加[0], 或者使用下面的形式 $('#'+street).addClass("current");
参考:
$('a[id*="street"]').click(function() { $('input[name="current_street"]').val(this.id); $('a[id*="street"]').removeClass('current'); this.className="current"; $('a[id*="distinct"]').removeClass('current'); $('input[name="current_distinct"]').val(""); });
转载于:https://www.cnblogs.com/fightLonely/archive/2011/05/30/2063105.html
相关资源:JAVA上百实例源码以及开源项目