我試圖讓元素在頁面上的輸出,這一點:獲取所有的ID開始以「X」
$('a#exportPage').on('click',function(){
ExportIds = $('[id^="appendHeading"]').attr('id');
ExportTexts = $('[id^="appendHeading"]').text();
$("#PrintIds").append("ObjectID:"+ExportIds+"Content:"+ExportTexts);
});
,但只得到「最後的ID」,但不是所有的人。我以前遇到過這個麻煩,需要把它放在我的腦海中!
我想要的輸出是 「對象ID:appendHeading,內容:文本,對象ID:appendHeading,內容:文本」 等,
提前感謝!
非常感謝你的一個很好的解釋!而你花了你的時間!萬分感激! – Kim 2013-04-27 23:35:38