我使用Pagedown需要为wmd-input
textarea 提供 id。在 中写成如下Markdown.Editor.js
:
function PanelCollection(postfix) {
this.buttonBar = doc.getElementById("wmd-button-bar" + postfix);
this.preview = doc.getElementById("wmd-preview" + postfix);
this.input = doc.getElementById("wmd-input" + postfix);
};
但是,我需要在项目的各个地方使用具有不同文本区域 ID 的编辑器。因此,最好使用 class 而不是 id 属性。怎样才能做到这一点?