Skip to content

Latest commit

 

History

History
79 lines (40 loc) · 1.07 KB

zotero-plugin-toolkit.basictool.createxulelement.md

File metadata and controls

79 lines (40 loc) · 1.07 KB

Home > zotero-plugin-toolkit > BasicTool > createXULElement

BasicTool.createXULElement() method

Create an XUL element

For Zotero 6, use createElementNS;

For Zotero 7+, use createXULElement.

Signature:

createXULElement(doc: Document, type: string): XUL.Element;

Parameters

Parameter

Type

Description

doc

Document

type

string

**Returns:**

XUL.Element

Example

Create a <menuitem>:

const compat = new ZoteroCompat();
const doc = compat.getWindow().document;
const elem = compat.createXULElement(doc, "menuitem");