缥缈止盈
ClassicEditor .create( document.querySelector( '#editor' ), { //工具栏,可选择添加或去除 toolbar: ['headings', 'bold', 'italic', 'blockQuote', 'bulletedList', 'numberedList', 'link', 'cut','undo','redo'], //toolbar: ['headings', 'bold', 'italic', 'blockQuote', 'bulletedList', 'numberedList', 'link', 'ImageUpload', 'cut','undo','redo'], //editor加载中文简体,默认是英文 language: 'zh-cn' //,ckfinder: { // uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json' //} //image: { // // You need to configure the image toolbar, too, so it uses the new style buttons. // toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ], // styles: [ // // This option is equal to a situation where no style is applied. // 'full', // // This represents an image aligned to the left. // 'alignLeft', // // This represents an image aligned to the right. // 'alignRight' , // 'side' // ] //}, } ) .then( editor => { window.editor = editor;} ) .catch( err => { console.error( err.stack );} ); var a = document.getElementById("editor"); //取得纯文本alert(a.innerHTML);alert(a.textContent);