A helper for `document.createElement()` that can be loaded into a script with `require`.
此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.greasyfork.org/scripts/559372/1716611/create-element-helper.js
Load it in the script header.
// @require https://update.greasyfork.org/scripts/559372/create-element-helper.js
tag() calls createElement() and returns a helper.
document.createElement('input')
// ↓
tag('input')
Set attributes by method chaining via helpers.
const input = document.createElement('input')
input.setAttribute('id', 'search')
input.classList.add('search')
// ↓
tag('input').id('search').cssClass('search')