我用的是现在的jQuery:
$(function() {
$('span .breadcrumb').each(function(){
$('#nav').addClass($(this).text());
$('#container').addClass($(this).text());
$('.stretch_footer').addClass($(this).text())
$('#footer').addClass($(this).text());
});
});
It applies the text held in the breadcrumb to 4 elements on the page, allowing me to style specifically to the page there on.
我想try 添加一个ID而不是一个类,我该如何实现这一点?