 Please user insertBefore() JS HTML DOM METHOD for add string before your element content <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Node.insertBefore" rel="nofollow">Check MDN</a></p> OR user appendChild() JS HTML DOM METHOD for add string after your element content <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Node.appendChild" rel="nofollow">Check MDN</a></p>