Javascript 函数在引导模式下不工作时的Jquery
我在jquery中触发事件时遇到问题。问题是我在引导模式输入字段上设置了一个on change事件。当我关闭模态时触发该事件,我希望它在模态打开时也会触发。请帮忙。谢谢Javascript 函数在引导模式下不工作时的Jquery,javascript,jquery,Javascript,Jquery,我在jquery中触发事件时遇到问题。问题是我在引导模式输入字段上设置了一个on change事件。当我关闭模态时触发该事件,我希望它在模态打开时也会触发。请帮忙。谢谢 <div class="modal-body"> <div class="col-md-6"> <p> <span><strong> Current Password:</strong></span>
<div class="modal-body">
<div class="col-md-6">
<p>
<span><strong> Current Password:</strong></span>
<input type="password" class="form-control" id="curr-pass" placeholder="Enter Current Password" name="pass" required />
</p>
</div>
</div>
使用onBlur或KeyUp事件,而不是更改..尝试使用blurevent $document.readyfunction{ $document.onblur、当前通行证、函数{ var password=$this.val; console.logpassword; }; }; 当前密码:
您是否尝试将其更改为输入事件,如在“输入”、“当前传递”和“键控工作”中。我真是个笨蛋,我已经用过很多次了,但是我忘记了。谢谢:
$(document).ready(function(){
$(document).on("change","#curr-pass",function(){
var password = $(this).val();
console.log(password);
});
});