我得到了一個<a>
包含區域<input type="text">
點擊<a>
將提交父窗體,在<a>
輸入是數量,因爲它現在試圖改變量就會觸發形成。我得到的東西我怎麼能做到這一點的想法,但我不知道如何完成的jQuery,所以我並欣賞一些幫助如何使不能點擊
這是我走到這一步,
$(document).ready(function() {
$('.submit-parent-form').click(function() {
alert($(this).children('#quantity').val());
});
$('.input-a-tag').focus(function(){
$(this).parent('.submit-parent-form') //here i need to prevent the click
});
});
HTML
<a class="submit-parent-form"><input id="quantity" type="text" class="input-a-tag" value="1" /></a>
編輯 我看到的不是我的解決方案不會工作我想如何根據該<a>
焦點之前得到的點擊,我如何能做到
任何想法 EDIT 2 的問題是,當我試圖去在一個標籤輸入,試圖改變
嘗試看看這個答案: http://stackoverflow.com/questions/775215/how-do-i-make-an-area -unclickable-with-css – Motocarota
感謝您的鏈接,但並不真正幫助我 –