// fill the element selector before run let elementInterval; let elementDefined = false function modifyElement(elementSelector) { const optionContainer = document.querySelector(elementSelector); if (!optionContainer) { return null } const subTitle = document.createElement('p'); subTitle.innerHTML = `TEST` optionContainer.appendChild(subTitle) elementDefined = true if(elementInterval) { clearInterval(elementInterval) } } if (!elementInterval) { elementInterval = setInterval(modifyElement(elementSelector), 50) }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter