我試圖將“焦點”事件綁定到文本框,這樣每次焦點到達它時,它都應該調用一個函數。但是,它不會觸發焦點事件。當我將光標放入文本框中時,沒有任何反應。每當單擊按鈕時,都會觸發綁定在“單擊”事件上的其他事件。下面是代碼片段:P.when('A', 'ready').register('dom-updater', function(A) {var $ = A.$;var render = function () { if (state.widgetType === "maker") { $('#saveData').bind('click', function(event) { saveInfoData(); }); $('#verifyBtn').bind('click', function(event) { validateData(); }); //This line does not work $( "#textBoxId" ).focus(function() { console.log( "Handler for .focus() called." ); });} else { //Do something else}};A.on.ready(function() { render();});}我嘗試過使用“模糊”和“對焦”,但它不起作用。$('#textBoxId').bind('blur', function(event) { console.log("IN blur call"); });為什么文本框未附加到焦點事件?
對焦/模糊事件未被觸發
慕神8447489
2022-09-23 21:49:26