⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 day5_3.html

📁 不错的javascript学习资料适合于刚刚学习javascirpt的出学者
💻 HTML
📖 第 1 页 / 共 2 页
字号:
  </tr>
  <tr> 
    <td colspan="2" bgcolor="#666699"> 
      <div align="center"><font color="#FFFFFF">更多教程</font></div>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="17"><a href="../../1hdml/index.html">-HDML</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="23"><font face="宋体"><a href="../../1-backend/database/course/day1_1.html">-网络数据库</a></font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="14"><a href="../../1-backend/protocols/ping/index.html"><font face="arial, helvetica, sans-serif">-ping</font></a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="20"><a href="../../1-backend/cgi_perl/search_engine/index.html">-创建搜索引擎</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" height="16">-<a href="../../1adobe/GoLive/index.html">Adobe GoLive</a></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2"><a href="../../1-backend/cgi_perl/templates/index.html">-模板</a></td>
  </tr>
  <tr bgcolor="#666699"> 
    <td colspan="2" align="center"><font color="#FFFFFF">合作伙伴</font></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" align="left">-<a href="http://www.5dmedia.com/" target="_blank">5D精英网</a></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF"> 
    <td colspan="2"> <img src="../../Library/front_monkey.gif" width="59" height="68"></td>
  </tr>
  </tbody> 
</table>
<!-- #EndLibraryItem --> </td>
 <!-- End of headlines (column 1: left column) --> <!-- Gutter between columns 1 and 2 --> 
 <td width="10" height="794"><img src="http://www.sohu.com/images/pixel.gif" width=10></td>
 <!-- Search box and directories (columns 2 and 3: middle columns, combined into one) --> 
 <td align=center valign=top width="558"> 
 <div align="left"><!-- #BeginEditable "1" --> 
<title>JavaScrip教程</title>
 <strong>第三页:<font size="3">控制文字域的值</font></strong> 
      <p><font size="3" face="宋体">将鼠标滑过该链接看看会发式什么事情。</font></p>
      <table>
        <tr> 
          <td colspan="2"> 
            <form name="first_form">
              <p> <font size="3"></font><font size="3" face="宋体"> 
                <input type="text" name="first_text" value="Are you happy?" size="20">
                </font></p>
            </form>
          </td>
          <td></td>
        </tr>
        <tr> 
          <td><font size="3" face="宋体"><a href="#" onMouseOver="window.document.first_form.first_text.value='Clap clap!';">Yes, 
            and I know it.</a> </font></td>
          <td><font size="3" face="宋体"><a href="#" onMouseOver="window.document.first_form.first_text.value='Sour puss!';">No!</a> 
            </font></td>
        </tr>
      </table>
      <p><font face="宋体">通过改变文字域的值就可实现这种奇妙的变换。</font>
      <ul>
        <pre><font face="宋体">
&lt;form name=&quot;first_form&quot;&gt;

&lt;input type=&quot;text&quot; name=&quot;first_text&quot; 
value=&quot;Are you happy?&quot;&gt;

&lt;/form&gt;

</font></pre>
      </ul>
      <p><font size="3" face="宋体">改变文字域的链接为:</font>
      <ul>
        <pre><font face="宋体">
&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.first_form.first_text.value='Clap clap!';&quot;&gt;
Yes, and I know it.&lt;/a&gt;

&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.first_form.first_text.value='Sour puss!';&quot;&gt;
No!&lt;/a&gt;

</font></pre>
      </ul>
      <p><font face="宋体">意思是说,表单调用第1个表单,并将其值设为 'Clap clap!'第<br>
        2行作用相似。这同改变图象的src非常相似。只不过文字域改变<br>
        的是值。 </font></p>
      <p><font face="宋体">对textareas也可以采用类似的方法改变值:</font></p>
      <table>
        <tr> 
          <td colspan="2"> 
            <form name="form_two">
              <p><font face="宋体"> 
                <textarea name="the_textarea" rows="10" cols="40">


Mouse over below to see the first verse of
The Webmonkey song, adapted from
&quot;I Wanna Be Like You&quot; (The Monkey Song)
from Walt Disney's The Jungle Book
written by Richard M. Sherman and Robert B. Sherman

</textarea>
                </font></p>
            </form>
          </td>
          <td></td>
        </tr>
        <tr> 
          <td><font face="宋体"><a href="#" onMouseOver="window.document.form_two.the_textarea.value=first_part;">Part 
            1</a> </font></td>
          <td><font face="宋体"><a href="#" onMouseOver="window.document.form_two.the_textarea.value=second_part;">Part 
            2</a> </font></td>
        </tr>
      </table>
      <p><font face="宋体">表单编码:</font>
      <ul>
        <pre><font face="宋体">&lt;form name=&quot;form_two&quot;&gt;

&lt;textarea name=&quot;the_textarea&quot; rows=10 cols=60&gt;

Mouse over below to see the first verse of

The Webmonkey song, adapted from

&quot;I Wanna Be Like You&quot; (The Monkey Song)

from Walt Disney's <cite>The Jungle Book</cite>

written by Richard M. Sherman and Robert B. Sherman

&lt;/textarea&gt;

&lt;/form&gt;

</font></pre>
      </ul>
      <p><font face="宋体">注意该表单有一个名字:<tt>form_two</tt>,,并且文字区也有一个名字:<br>
        <tt>the_textarea</tt>。 </font></p>
      <p><font face="宋体">其链接和文字域的设定方法基本相同: </font>
      <ul>
        <pre><font face="宋体">&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.form_two.the_textarea.value=first_part;&quot;&gt;
Part 1&lt;/a&gt;

&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.form_two.the_textarea.value=second_part;&quot;&gt;
Part 2&lt;/a&gt;

</font></pre>
      </ul>
      <p><font face="宋体">唯一的不同之处在于将一个变量赋值给textareas,而不<br>
        是将字符串赋值给它。该变量在HTML首部已经做了定义。<br>
        以下是变量的字符串赋值:</font>
      <ul>
        <pre><font face="宋体">
var first_part = &quot;Now I'm the king of the swingers\nOh, 
the jungle VIP\nI've reached the top and had to stop\nAnd 
that's what botherin' me&quot;;

</font></pre>
      </ul>
      <p> </p>
      <p><font face="宋体">注意<tt>&quot;\n&quot;</tt>是换行符。如果你在一个<tt>&lt;pre&gt;</tt> 
        并且或在一个<br>
        textarea中写字,<tt>&quot;\n&quot;</tt> 换行符非常方便。</font></p>
      <p><font face="宋体">除了改变表单元素的值,JavaScript还可以让你检测在表<br>
        单中进行的事件。</font>
      <ul>
        <pre><font face="宋体">&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.form_two.the_textarea.value=first_part;&quot;&gt;
Part 1&lt;/a&gt;

&lt;a href=&quot;#&quot; 
onMouseOver=&quot;window.document.form_two.the_textarea.value=second_part;&quot;&gt;
Part 2&lt;/a&gt;

</font></pre>
      </ul>
      <p><font face="宋体">唯一的不同之处在于将一个变量赋值给textareas,<br>
        而不是将字符串赋值给它。该变量在HTML首部已经做<br>
        了定义。以下是变量的字符串赋值:</font>
      <ul>
        <pre><font face="宋体">var first_part = &quot;Now I'm the king of the swingers\nOh, 
the jungle VIP\nI've reached the top and had to stop\nAnd 
that's what botherin' me&quot;;

</font></pre>
      </ul>
      <p> </p>
      <p><font face="宋体">注意<tt>&quot;\n&quot;</tt>是换行符。如果你在一个<tt>&lt;pre&gt;</tt> 
        并且或在一个<br>
        textarea中写字,<tt>&quot;\n&quot;</tt> 换行符非常方便。</font></p>
      <p><font face="宋体">除了改变表单元素的值,JavaScript还可以让你检测在<br>
        表单中进行的事件。<a href="day5_4.html">&gt;&gt;</a></font></p>
      <p align="left"><font face="宋体" size="3" color="#000000"><strong>JavaScript教程</strong></font><font color="#FF0000" face="宋体" size="3"><br>
        </font><font size="3"><font color="#FF0000">第一页</font> <a href="day5_3.html">第五课课程介绍</a><br>
        <font color="#FF0000">第二页</font> <a href="day5_2.html">介绍反馈表单</a><br>
        <font color="#FF0000">第三页</font> 控制文字域的值<br>
        <font color="#FF0000">第四页</font> <a href="day5_4.html">文字域事件</a><br>
        <font color="#FF0000">第五页</font> <a href="day5_5.html">反馈表单处理器</a><br>
        <font color="#FF0000">第六页</font> <a href="day5_6.html">文字域的练习</a><br>
        <font color="#FF0000">第七页</font> <a href="day5_7.html">复选框</a><br>
        <font color="#FF0000">第八页</font> <a href="day5_8.html">单选框</a><br>
        <font color="#FF0000">第九页</font> <a href="day5_9.html">选单</a><br>
        <font color="#FF0000">第十页</font> <a href="day5_10.html">在选单中应用<font face="宋体">onchange</font>命令</a></font></p>
      <p align="left"><font face="宋体" size="3">[<a href="index.html">第1课</a>][<a href="day2_1.html">第2课</a>][<a href="day3_1.html">第3课</a>][<a href="day4_1.html">第4课</a>][第5课]</font></p>
      <!-- #EndEditable --></div>
 </td>
 <!-- End of search box and directories (columns 2 and 3: middle columns, combined into one) --> 
 <!-- Gutter between columns 3 and 4 --> <!-- Other stuff (column 4: right column) --> 
 <!-- End of other stuff (column 4: right column) --> </tr>
 </table>
<!-- End of table surrounding page contents -->

 <hr noshade size=1 width=700>
 <span class=eng><br>
 Copyright (C) 1998-2000 Internet Technologies China.&nbsp; All rights reserved. 
 </span> 
</center>
</body>
<!-- #EndTemplate --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -