<div>Click me <span>+</span></div> <style> div{ padding:10px; position:relative; } </style> <script> document.querySelector("div").onclick =e=> e.target.children[0].textContent = e.target.children[0].textContent === '+'?'-':'+'; </script>