Javascript examples for String:indexOf
Find the index of a word in the whole sentence
<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 om*/ var str = 'something footer=bob and something=earl'; str = str.replace(/footer=(.*?)\s/g, 'footer=whatever'); document.body.innerHTML = str; }); </script> </head> <body> </body> </html>