解决方案 »

  1.   

    ReferenceError: getResult is not defined
      

  2.   

    function getResult(id)
    {
    alert(document.getElementById(id).value);
    }
    怎么没有定义啊
      

  3.   

    你把 <script language="text/javascript">  换成 <script type="text/javascript"> 试试
      

  4.   

    把 <script language="text/javascript">  换成 <script type="text/javascript">还是不行啊
      

  5.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script>
    function getResult(id)
    {
    alert(document.getElementById(id).value);
    }
    </script>
    </head><body>
    <table>
    <tr>
    <td>请输入操作数:</td>
    <td><input type="text" id="text1"></td>
    </tr><tr>
    <td></td>
    <td>
    <input type="button" id="radio1" value="确定" onclick="getResult('text1')"/>
    </td>
    </tr>
    </table>
    </body>
    </html>
      

  6.   

    在把 onclick="getResult("text1")"  里面text1 用单引