Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.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将输入类型密码中的值发送到其他intup?_Javascript - Fatal编程技术网

如何使用javascript将输入类型密码中的值发送到其他intup?

如何使用javascript将输入类型密码中的值发送到其他intup?,javascript,Javascript,如何使用javascript将输入类型密码中的值发送到其他intup 首先,将数据填入 <input type="text" onchange="updateInput_current_password(this.value)"> 然后输入数据 <input type="text" name="current_password_for_check" id="current_password_for_check"/> 将随之改变 但是当我申请使用 <input

如何使用javascript将输入类型密码中的值发送到其他intup

首先,将数据填入

<input type="text" onchange="updateInput_current_password(this.value)">
然后输入数据

<input type="text" name="current_password_for_check" id="current_password_for_check"/>  
将随之改变

但是当我申请使用

<input type="password" onchange="updateInput_current_password(this.value)">
为什么,价值在哪里

<input type="text" name="current_password_for_check" id="current_password_for_check"/>
不改变

我该怎么做

<script type="text/javascript">
function updateInput_current_password(current_passwordvalue){
    document.getElementById("current_password_for_check").value = current_passwordvalue;
}
</script>


<input type="password" onchange="updateInput_current_password(this.value)">


<form id="current_password_send_value_fid">
    <input type="text" name="current_password_for_check" id="current_password_for_check"/>  
</form>

你应该这样做:

HTML:
您可以更改输入过程的事件

<input type="password" onkeydown="updateInput_current_password(this.value)" onkeyup="updateInput_current_password(this.value)" />

删除此行:发送\u当前\u密码\u进行\u检查\u不正确\u或\u不正确;它工作得很好。我只想用onchange
var inpt = document.querySelctor('input[type="password"]');

inpt.onkeydown = function() {
    alert(inpt.value);
}
<input type="password" onkeydown="updateInput_current_password(this.value)" onkeyup="updateInput_current_password(this.value)" />