Enter multiple option without requiring intermedia saves.
document.addEventListener('DOMContentLoaded', () => {
+ document.querySelectorAll('.multiinput > input[id]').forEach(el => {
+ el.oninput = e => {
+ if (e.target.value == '') return;
+ let add = e.target.cloneNode(true);
+ add.value = '';
+ add.oninput = e.target.oninput;
+ e.target.parentNode.appendChild(add);
+ e.target.oninput = undefined;
+ e.target.removeAttribute('id');
+ };
+ });
+
let wpinput = document.getElementById('wptitle');
if (wpinput) {
let wpbutton = wpinput.parentNode.appendChild(document.createElement('button'));