;);txt+= \" A & lt;br >;;}//var?元素?=?document . createelement(' a ');//將文本寫入element.setAttribute('href '," />
特定代碼:
& lt腳本& gt
var?txt?=?"";
for(var?I = 0;我& lt5;i++){
document . write(" A & lt;br >;);
txt+= " A & lt;br >;;
}
//
var?元素?=?document . createelement(' a ');
//將文本寫入
element.setAttribute('href ',?數據:文本/純文本;charset=utf-8,'?+?encodeURIComponent(txt));
//設置要另存為的名稱。
element.setAttribute('download ',?“結果”);
element.style.display?=?“無”;
document.body.appendChild(元素);
element . click();
document . body . remove child(element);
& lt/script & gt;
快樂編程。如果有用,請點擊采納。謝謝妳。