亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

html標簽ID中的特殊字符

html標簽ID中的特殊字符

白板的微信 2019-12-06 11:12:07
在html代碼中,我正在使用代碼 <input type = "text" id = "[email protected]">獲取文本,現在它需要獲取在文本字段中輸入的值。我正在使用jQuery來做到這一點:$( document ).ready( function() {    $( ".bid" ).click( function() {        idVal = this.id        bidID = "#" + idVal + "bid"        spanID = "#" + idVal + "cbid"        bidValue = $(bidID).val();        alert(idVal)        alert(bidID)        alert(bidValue) //this alert says undefined        $( spanID ).html( '&nbsp;' ).load( '{% url online_machines %}?id=' + idVal + '&bidvalue=' + bidValue);    });});通過這樣做我得到未定義的值錯誤。我試圖從ID中刪除特殊字符以獲取其值。但是我需要帶特殊字符的ID。如何使用jquery獲得其值?
查看完整描述

3 回答

  • 3 回答
  • 0 關注
  • 1026 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號