jQuery找不到我的元素.为什么? [英] JQuery can't find my Element. Why?

查看:177
本文介绍了jQuery找不到我的元素.为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:愚蠢的我没注意到CASE是不正确的.我为此苦苦挣扎了30多分钟,而你们在不到5分钟的时间内看到了我的问题!!感谢您为我省去了很多麻烦-无论如何我还是编程的新手,我需要学习如何寻找像这样的小东西,但是非常感谢,它甚至还没让我念念不忘:)

对不起,每个人-以前是令人误解的,因为我忘记在问题中加引号了,但是我可以向您保证,我知道Jquery的选择器需要引号,而且我一直在使用引号.

<div id='question' style="background-color:#DAE2E8;border-color:#A2B3C7;border-width:1px;border-style:solid"><br /> 
    <table id='searchtable' border='0'>
        <tr>
            <td><span class="label">Question ID:</span><input id='QuestionId' type='text'/></td>
            <td><span class="label">Question Title:</span><input id='QuestionTitle' type='text'/></td>
            <td><span class="label">Original URL:</span><input id='OriginalURL' type='text'/></td>
            <td><span class="label">Original Title:</span><input id='OriginalTitle' type='text' /></td>
            <td><span class="label">Chronic ID:</span><input id='ChronicID' type='text' /></td>   
        </tr><tr>
            <td><span class="label">Expert Name:</span><input id='ExpertName' type='text'/></td>  
            <td><span class="label">Topic ID:</span><input id='TopicID' type='text'/></td>
            <td><span class="label">Channel ID:</span><input id='ChennelID' type='text''/></td>
            <td><span class="label">Funded: </span><input id='IsFunded' type='text'/></td>
            <td><span class="label">Funded Partner:</span><input id='FundedPartner' type='text'/></td>
        </tr><tr>
            <td><input type="submit" value="Submit" onclick='ApplyNewFilters(this)' /></td>
        </tr>  
    </table>
</div>

这是我的HTML代码(位于aspx页面中)-我尝试使用$("#QuestionID").val()来获取值,但无法正常工作.我也尝试过$("input#QuestionID").val().

So here is my HTML code (its in an aspx page) - I tried using $("#QuestionID").val() to get the value, but it won't work. I also tried $("input#QuestionID").val().

推荐答案

尝试使用:

$("#QuestionId").val()

请注意引号和确切的大小写.

Note the quotes and exact case.

此处的示例

这篇关于jQuery找不到我的元素.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆