alert(${"testSort"}.value);  为什么不能弹出值?
alert(document.getElementById("testSort").value);却可以弹出值.需要引入什么东西吗?

解决方案 »

  1.   

    请教一下,即便导入了jquery,JQ里有支持 ${"testSort"} 么
      

  2.   

    jquery如何导入? 同一工程,其他页面可以.  但是不知道怎么导入jquery
      

  3.   

    <script language="javascript" src="../jquery/jquery-1.3.2.min.js"></script>
      

  4.   

    有的,但是必须这样写,LZ写法出错,可能是刚接触jquery吧
    val = $("#id")[0].value;
      

  5.   

    分给我吧
    $("#testSort").val()
      

  6.   

    jquery
    $("#testSort").val()自定义函数
    $("testSort").value;分给楼上吧
      

  7.   

    <!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>js测试</title>
    <style type="text/css">
    </style>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script><script type="text/javascript">
        $(document).ready(function()
        {
            alert($("#testSort").val());
            alert($("#testSort").attr("value"));
        });</script>
        
    </head>
    <body>
    <input id="testSort" type="text" value="hellow!" /></body>
    </html>
      

  8.   

    http://www.diysys.com有很多关于php,mysql,js,css的信息,适合新手和进阶者
      

  9.   

    先导jquery包你那写法错的
    应该是$("#id").val();
      

  10.   

    是这个吧 alert($("testSort").value);
      

  11.   

    为什么认定是jQuery库呢
    不可以是其他的么~简单来说 那个不是js本身的方法
    是其他库定义的 什么库就不知道了可以学学jQuery 但之前有CSS的知识就更好了
      

  12.   

    alert(${"testSort"}.val());

    alert(${"testSort"}.get(0).value);  
      

  13.   

    alert($("testSort").value);function $(uid)
    {
     return document.getElementById(uid);
    }这样也可以,对于JQurey来说是,以假乱真。
      

  14.   

    Javascript源码分析 QQ群:84507704  欢迎大家加入 共同讨论 共同进步
      

  15.   

    alert(${"testSort"}.val());

    alert(${"testSort"}.get(0).value);