Replace all in div or textarea content using javascript To replace from div use(innerHTML) in javascript: <div id="ss">replace all with javascript</div> <button onclick="replaceall()">replaceAll</button> <script> function replaceall(){ var repall=document.getElementById("ss").innerHTML; var repall_1=repall.split(" ").join("-") document.getElementById("ss").innerHTML=repall_1 } </script> To replace from input or textarea use(value) in javascript: <textarea id="tex" style="width:100%">replace all with javascript</textarea> <button onclick="replaceall1()">replaceAll</button> <script> function replaceall1(){ var repall=document.getElementById("tex").value; var repall_1=repall.split(" ").join("-") document.getElementById("tex").value=repall_1 } </script> © 2025 Manajmnt code Share to : ☷✎ Related HTML tags remover online Are you tired of manually deleting HTML tags? Save time and delete them with one click A… Read MoreSave textarea content to local file using file system access API [ demo & source code ] <button id="saveas" save as</button <textarea id="textarea" style="width… Read MoreCreate direct download link for google drive file online .inputdr { width: 100%; padding: 7px; margin: 9px auto; } .tilte12 { margin: 5 auto; padding: 5p… Read More Comments
Comments
Post a Comment
message