下面是HTML我有如何註冊點擊事件AJAX加載內容
<input type="text" name="post[price]" id="productUpdate" class="test" disabled />
<div class="abs-locator" id="eventDrive"></div>
這裏是我的CSS
.abs-locator{
width: 17.8%;
position: absolute;
margin-top: -29px;
margin-left: 150px;
height: 27px;
}
我需要執行click事件被點擊
隱藏輸入框時這裏是我的js
$('#eventDrive').on('click', function() {
alert('test');
});
但這裏沒有任何反應。爲什麼會發生這種情況以及如何解決它
「我需要執行click事件被點擊隱藏輸入框時「,不明白,對不起。你怎麼能點擊隱形? – RafH
這就是爲什麼我創建了一個絕對定位輸入的div – overflow
http://jsfiddle.net/yiernehr/B2Bcf/2/ – RafH