Javascript-创建元素<;人力资源>;内联样式
我想修改ckeditor的horizontalrule插件:Javascript-创建元素<;人力资源>;内联样式,javascript,css,function,ckeditor,Javascript,Css,Function,Ckeditor,我想修改ckeditor的horizontalrule插件: ... exec: function( editor ) { var hr = editor.document.createElement( 'hr' ); editor.insertElement( hr ); }, allowedContent: 'hr', requiredContent: 'hr' }; ... 此插件生成: <hr /> 但我想得到
...
exec: function( editor ) {
var hr = editor.document.createElement( 'hr' );
editor.insertElement( hr );
},
allowedContent: 'hr',
requiredContent: 'hr'
};
...
此插件生成:
<hr />
但我想得到sg。比如:
<hr style="color:#FFF; height:2px;" />
有谁能帮我解决这个问题吗
hr.style.color = "#FFF";
hr.style.height = "2px";
您几乎可以在任何时候对
hr
变量执行此操作。我尝试了此allready,但它不起作用。这似乎是ckeditor的一个特定问题