Source Code for a Sample Page That Formats a String Object with the 'a' Tag : String : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » String »

 

Source Code for a Sample Page That Formats a String Object with the 'a' Tag



<html>
<head>
  <title>String Object Hypertext Formatting</title>
  <script language="JavaScript1.1" type="text/javascript">
  <!--
    function showWindow(){
      var txt = document.form1.stringField.value
   
      if (document.form1.hypertext[0].checked){
        txt = txt.link(document.form1.jumptoField.value);
      }else{
        if (document.form1.hypertext[1].checked){
          txt = txt.anchor(document.form1.jumptoField.value);
        }
      }
   
      alert(txt);
    }
  //-->
  </script>
</head>
<body>
  <h1>
    String Object Hypertext Formatting
  </h1>
  <hr>
  <form method="POST" name="form1">
    <p>
      Text:
      <input type=text size=20 maxlength=256 name="stringField">
      <input type=radio name="hypertext" value="Link" checked>
      Link:
      <input type=radio name="hypertext" value="Anchor">
      Anchor:
    </p>
    <p>
      Jump To:
      <input type=text size=20 maxlength=256 name="jumptoField">    </p>
    <input type="button" name="Show" value="Show" onClick="showWindow()">
  </form>
</body>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» String