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

查看:69
本文介绍了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()获取值,但不起作用。我也试过 $(输入#QuesnerID)。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()

注意报价和确切情况。

示例在这里

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

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