A helper for `document.createElement()` that can be loaded into a script with `require`.
このスクリプトは単体で利用できません。右のようなメタデータを含むスクリプトから、ライブラリとして読み込まれます: // @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')