Javascript examples for RegExp:Match HTML
Remove from html using regex
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w . j av a 2 s. c o m*/ var el = document.querySelector('.country-IN'); el.innerHTML = el.innerHTML.replace(/ /g,''); } </script> </head> <body> <div class="country-IN"> <span class="locality">locality</span> <span class="state">state</span> <span class="country">country</span> </div> </body> </html>