Textarea array?

Discussion in 'JavaScript' started by rudd, Jun 11, 2008.

  1. #1
    Hi, I need help, can someone convert this code to me. Make the generated content to become like
    <a href="links" rel="nofollow">a</a>
    Code (markup):
    instead the one i post? Here are the codes.

    <script type="text/javascript">
             function doStuff()
             {
             var txt = "";
             document.getElementById("gen").value = "";
             
             if (document.getElementById("downlinks").value != ""){
             txt = "";
             txt += "<code>";
             txt += document.getElementById("downlinks").value;
             txt += "</code>\n";
             document.getElementById("gen").value += txt;
             }
             }
    </script>
    <body>
          <FORM name="frm"  action="#">
          <table>
    	     <tr>
                <td>Download Links:</td><br>
                <td><TEXTAREA id="downlinks" cols="49" rows="5"></TEXTAREA></td>
             </tr><tr>
                         <td style="text-align: right;" colspan="2">
                <INPUT class="btn" type="button" onclick="doStuff()" value="Generate">
                <INPUT class="btn" TYPE="reset">            
                </td>
             </tr></table>
    	  <table>
    		<tr><td colspan="2"><TEXTAREA id="gen" cols="62" rows="5">Generated content</TEXTAREA></td></tr>
    	  </table>
          </FORM>
    
       </BODY>
    Code (markup):

     
    rudd, Jun 11, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    What do you want to do? :confused:
    You want to change the output of the function from "<code>" to "<a>"?
     
    ToddMicheau, Jun 11, 2008 IP