[英]How can i call function on view on the click event of Id, function is written on controller in backbone.js
[英]how i can add a id in js on click event
嘿,我是Java腳本新手,請幫幫我
我有一個input
標簽,所以我想要的是當某些主體單擊input
標簽時, #helptext
將由js自動調用。
我如何在演示代碼和所需結果圖像下面實現這一目標。
我想要這張圖片:-
請檢查我標記中更新的DEMO更新,我需要像當前演示一樣
嘗試這個 :
$(document).ready(function() {
$("a").click(function(event) {
$(this).append(event.target.id);
});
});
$('input').focus(function() {
$('#helptext').show();
});
這是工作中的JSFiddle
$('#myInput').focus(function() {
$('#helptext').show();
});
$('#myInput').blur(function() {
$('#helptext').hide();
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.