<table class="table" width="100%" layouth="138">
            <thead>
                <tr>
                    <th>
                        状态
                    </th>                        
                </tr>
            </thead>
            <tbody>
                @foreach (var Storage in ViewBag.StorageList)
                {
                    <tr onmousedown="showVaule()">
                        <td id="statusid">@Storage.STATUS
                        </td>                                                                                 
                    </tr>
                }
           </tbody>
 </table>
==============================================
<script type="text/javascript">
    function showTypeInfo() {
        alert($("#statusid").val());  //没用呢?
            }
</script>

解决方案 »

  1.   

    function showVaule()
    是这样的...一时打快了 还望求助  自己顶个 
      

  2.   

    string value=$("#控件的客户端名").Val()
      

  3.   

    没有控件啊就是<td>@Storage.STATUS</td>我就是想
    alert(Storage.STATUS) 好纠结啊
      

  4.   

    <td id="">@Storage.STATUS</td>
    string value=$("#<%=控件的客户端名%>").Val()
      

  5.   

    你这里循环遍历生成的<td>,id都一样的怎么获取。
      

  6.   

    我也实验过了,可是没用
    <td id ="ShowIt">@Storage.STATUS</td>
    $("#statusid").val() = "" 的
      

  7.   

    <td id="qq">@Storage.STATUS</td>
    string value=$("#qq").Val()
      

  8.   

    "#ShowIt" 是这个 = “”
      

  9.   


    <tr onmousedown="showVaule()">
    Tr不是有一个点击此行的事件吗?
      

  10.   

    var Result=document.getelementByid("id值").value;
      

  11.   

    你试试 text 
    $("#statusid").text 
      

  12.   

     id应该唯一。。------------------------------------------------------------------------------
    <table class="table" width="100%" layouth="138">
      <thead>
      <tr>
      <th>
      状态
      </th>   
      </tr>
      </thead>
      <tbody>
      @foreach (var Storage in ViewBag.StorageList)
      {
      <tr onmousedown="showVaule(this)">
      <td>@Storage.STATUS
      </td>   
      </tr>
      }
      </tbody>
     </table>
    ==============================================
    <script type="text/javascript">
      function showTypeInfo(t) {
      alert($(t).find("td").eq(0).val());
      }
    </script>
      

  13.   


    是的,td应该用.text()或者.html()
      

  14.   

    text() 始终都是取的第一行的嘛?
      

  15.   

    你循环N次,但ID 只有一个