8. Write a JavaScript to find a string from the given text. If the match is found then replace it with another string.
<!-- --------------------------------------------------------------------------------------------------------------------------------- HTTP://WWW.GTUMCA.CO.CC ---share your college materials on --- [email protected] JOIN US ON FACEBOOK: with more than 1000 GTU MCA FRIENDS TWITTER @MCAGTU ---------------------------------------------------------------------------------------------------------------------------------------> <html> <head> <script > function findout(form) { var str=new String(form.string1.value); form.string1.value=str.replace(form.find.value,form.replac.value); } </script>
</head>
<body > <form> Enter a Text : <input name="string1" size=50><br/><br/> Word to find : <input name="find" ><br/> Word to Replace : <input name="replac"><br/> <input value="REPLACE" onClick="findout(this.form)"> </form>