Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我没有运气获得正确的语法来组合这些 jquery 行。append 可以与 attr() 一起使用,还是只需要单独调用或在回调中调用?它也不必附加,它是唯一写入该元素的东西,我只是不知道任何其他获取文本的方式。
$('#People').append(array.names[9]); $('#People').attr({ class: 'blueDescriptorBig' });
我不确定我是否理解正确,但请参见下文
$('#People') .append(array.names[9]) .addClass('blueDescriptorBig'); //Should use addClass instead of .attr for class