Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 函数在引导模式下不工作时的Jquery_Javascript_Jquery - Fatal编程技术网

Javascript 函数在引导模式下不工作时的Jquery

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>

我在jquery中触发事件时遇到问题。问题是我在引导模式输入字段上设置了一个on change事件。当我关闭模态时触发该事件,我希望它在模态打开时也会触发。请帮忙。谢谢

<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);
    });
});