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

📄 day5_8.html

📁 javascript的学习文章
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    <td colspan="2">-<a href="../../1-teach/asp/index.html">ASP</a></td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-teach/php/index.html">PHP</a></td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-teach/java/index.htm">Java</a></td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-teach/vb/index.htm">VB</a></td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-teach/c/index.htm">C、C++</a></td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-backend/database/php_mysql/index.html">PHP/MySQL</a></td>
  </tr>
  <tr> 
    <td colspan="2"><a href="../../1-backend/cgi_perl/perl_beginner/index.html">-Perl</a> 
    </td>
  </tr>
  <tr> 
    <td colspan="2">-<a href="../../1-teach/other/index.htm">其它</a> </td>
  </tr>
  <tr> 
    <td colspan="2" bgcolor="#666699"> 
      <div align="center"><font color="#FFFFFF">更多教程</font></div>
    </td>
  </tr>
  <tr> 
    <td colspan="2" height="17"><a href="../../1hdml/index.html">-HDML</a></td>
  </tr>
  <tr> 
    <td colspan="2" height="23"><font face="宋体"><a href="../../1-backend/database/course/day1_1.html">-网络数据库</a></font></td>
  </tr>
  <tr> 
    <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> 
    <td colspan="2" height="20"><a href="../../1-backend/cgi_perl/search_engine/index.html">-创建搜索引擎</a></td>
  </tr>
  <tr> 
    <td colspan="2" height="16">-<a href="../../1adobe/GoLive/index.html">Adobe GoLive</a></td>
  </tr>
  <tr> 
    <td colspan="2"><a href="../../1-backend/cgi_perl/templates/index.html">模板</a></td>
  </tr>
  <tr> 
    <td colspan="2" align="center" bgcolor="#666699"><font color="#FFFFFF">合作伙伴</font></td>
  </tr>
  <tr> 
    <td colspan="2" align="left">-<a href="http://www.5dmedia.com/" target="_blank">5D精英网</a></td>
  </tr>
  <tr align="center"> 
    <td colspan="2"> <img src="../../Library/front_monkey.gif" width="59" height="68"></td>
  </tr>
  </tbody> 
</table>
<br><!-- #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 align="JUSTIFY"><font size="3"></font><font size="4"> </font></p>
      <table width="445" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="445"> <font size="2"></font><font size="3">在<font face="宋体">JavaScript</font>中单选框的用法和复选框是否相似。不同之处<br>
            在于<font face="宋体">HTML</font>中的应用。复选框是一种开关。如果一个复选框被<br>
            选中,你可以再点击后取消选取<font face="宋体">. </font>但如果单选框被选中,则<br>
            只能通过选取另外一个单选框才能取消对该单选框的选取。例: 
            <form>
              <p> 
                <input type="radio" name="blah" value="larry" checked>
                <font face="宋体">Larry<br>
                <input type="radio" name="blah" value="moe">
                Moe<br>
                <input type="radio" name="blah" value="curly">
                Curly<br>
                </font></p>
            </form>
            <p>在该例中,如果你打算取消对对一个单选框的选取,你必须<br>
              集电极另一个单选框。用这种概念我们可以用两个单选框的<br>
              设为代替一个复写纸的试着发式:</p>
            <form name="form_1">
              <p> <font color="red"> 
                <input type="radio" name="radio_1" onClick="offButton();">
                </font><font face="宋体" color="red">Light off<br>
                <input type="radio" name="radio_2" onClick="onButton();" checked>
                Light on<br>
                </font></p>
            </form>
            <p>表单编码如下:
            </font></td>
        </tr>
      </table>
      <ul>
        <pre><font face="宋体"><big>&lt;form name=&quot;form_1&quot;&gt;

&lt;input type=&quot;radio&quot; name =&quot;radio_1&quot; </big>
<big>onClick=&quot;offButton();&quot;&gt;Light off

&lt;input type=&quot;radio&quot; name =&quot;radio_2&quot; </big>
<big>onClick=&quot;onButton();&quot; checked&gt;Light on

&lt;/form&gt;

</big></font></pre>
      </ul>
      <table width="434" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="434"><font face="宋体" size="3">当第一个单选框被选中时,<tt>函数offButton()</tt> 
            被调用。函数<br>
            如下: </font></td>
        </tr>
      </table>
      <ul>
        <pre><font face="宋体"><big>function offButton()

{

var the_box = </big>
<big>window.document.form_1.radio_1;

	

if (the_box.checked == true) </big>
<big>{
window.document.form_1.radio_2.checked = false;

document.bgColor='black';

alert(&quot;Hey! Turn that back on!&quot;);	

}

}

</big></font></pre>
      </ul>
      <table width="438" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="438"><font face="宋体" size="3">这个例子很象前面的复选框例子,主要的区别在于该行: </font></td>
        </tr>
      </table>
      <ul>
        <pre><big><font face="宋体">window.document.form_1.radio_2.checked = false;

</font></big></pre>
      </ul>
      <table width="434" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="434"><font face="宋体" size="3">该行指令指示JavaScript在该按钮被点击时关闭另外一个<br>
            按钮。由于另外一个按钮的函数同这个很相似: </font></td>
        </tr>
      </table>
      <ul>
        <pre><font face="宋体"><big>function onButton()

{

var the_box = window.document.form_1.radio_2;

if (the_box.checked == true) </big>
<big> {

window.document.form_1.radio_1.checked = false;

document.bgColor='white';

alert(&quot;Thanks!&quot;);

}

}

</big></font></pre>
      </ul>
      <p align="left"><a href="day5_9.html">&gt;&gt;</a></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_8.html">第五课课程介绍</a><br>
        <font color="#FF0000">第二页</font> <a href="day5_2.html">介绍反馈表单</a><br>
        <font color="#FF0000">第三页</font> <a href="day5_3.html">控制文字域的值</a><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> 单选框<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 + -