topical media & game development

talk show tell print

basic-javascript-08-ch8-examp4.htm / htm

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <script language="JavaScript" type="text/JavaScript">
  function replaceQuote(textAreaControl)
     var myText = textAreaControl.value;
     var myRegExp = /\B'|'\B/g;
     myText = myText.replace(myRegExp,'"');
     textAreaControl.value = myText;
  <form name="form1">
  <textarea rows="20" cols="40" name="textarea1">
  'Hello World' said Mr O'Connerly.
  He then said 'My Name is O'Connerly, yes that's right, O'Connerly'.
  <input type="button" VALUE="Replace Single Quotes" name="buttonSplit"

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.