Html 类型=";密码";对类型的更改=";“文本”;选择字段时

Html 类型=";密码";对类型的更改=";“文本”;选择字段时,html,Html,我在网上有一张登录表 如果您访问页面并检查输入字段中的密码元素,您可以看到,当选择该字段时,type=“password”将更改为type=“text”,这将导致在键入任何内容时显示密码。取消选择时,type=“text”字段将转换回type=“password”,然后隐藏密码 知道是什么导致了这个问题吗?这是clientResponse.js的第一行: $("[type='password']").focus(function () { this.type = "text"; }).b

我在网上有一张登录表

如果您访问页面并检查输入字段中的密码元素,您可以看到,当选择该字段时,type=“password”将更改为type=“text”,这将导致在键入任何内容时显示密码。取消选择时,type=“text”字段将转换回type=“password”,然后隐藏密码


知道是什么导致了这个问题吗?

这是clientResponse.js的第一行:

$("[type='password']").focus(function () {
    this.type = "text";
}).blur(function () {
    this.type = "password";
})
删除它,它应该像您希望的那样工作

你的是缩小了,但我美化了它,使它看起来更干净

$(document).ready(function () {
    $('#requestTitle').blur(function () {
        if ($.trim($(this).val()) == "") {
            $(this).addClass("empty");
            $(this).animate({
                marginLeft: "15px"
            }, 200);
            $(this).animate({
                marginLeft: "0px"
            }, 200);
            return (false);
        }
        return (true);
    });
    $("#requestTitle").change(function () {
        if ($(this).hasClass("empty")) {
            $(this).removeClass("empty");
        }
    });
    $('#requestDesc').blur(function () {
        if ($.trim($(this).val()) == "") {
            $(this).addClass("empty");
            $(this).animate({
                marginLeft: "15px"
            }, 200);
            $(this).animate({
                marginLeft: "0px"
            }, 200);
            return (false);
        }
        return (true);
    });
    $("#requestDesc").change(function () {
        if ($(this).hasClass("empty")) {
            $(this).removeClass("empty");
        }
    });
    $('#timeFrame').blur(function () {
        if ($.trim($(this).val()) == "") {
            $(this).addClass("empty");
            $(this).animate({
                marginLeft: "15px"
            }, 200);
            $(this).animate({
                marginLeft: "0px"
            }, 200);
            return (false);
        }
        return (true);
    });
    $("#timeFrame").change(function () {
        if ($(this).hasClass("empty")) {
            $(this).removeClass("empty");
        }
    });
    $('.alertMsg .alert-close').each(function () {
        $(this).click(function (event) {
            event.preventDefault();
            $(this).parent().fadeOut("slow", function () {
                $(this).css('diplay', 'none');
            });
        });
    });
    $('.tool-tip').hover(function () {
        var title = $(this).attr('title');
        $(this).data('tipText', title).removeAttr('title');
        $('<p class="tooltip"></p>').text(title).appendTo('body').fadeIn(
            'slow');
    }, function () {
        $(this).attr('title', $(this).data('tipText'));
        $('.tooltip').remove();
    }).mousemove(function (e) {
        var mousey = e.pageY + 0;
        var mousex = e.pageX + -20;
        $('.tooltip').css({
            top: mousey,
            left: mousex
        })
    });
});
$(文档).ready(函数(){
$('#requestTitle').blur(函数(){
if($.trim($(this).val())==“”){
$(此).addClass(“空”);
$(此)。设置动画({
边缘左侧:“15px”
}, 200);
$(此)。设置动画({
marginLeft:“0px”
}, 200);
返回(假);
}
返回(真);
});
$(“#requestTitle”).change(函数(){
if($(this).hasClass(“空”)){
$(此).removeClass(“空”);
}
});
$('#requestDesc').blur(函数(){
if($.trim($(this).val())==“”){
$(此).addClass(“空”);
$(此)。设置动画({
边缘左侧:“15px”
}, 200);
$(此)。设置动画({
marginLeft:“0px”
}, 200);
返回(假);
}
返回(真);
});
$(“#requestDesc”).change(函数(){
if($(this).hasClass(“空”)){
$(此).removeClass(“空”);
}
});
$('#timeFrame').blur(函数(){
if($.trim($(this).val())==“”){
$(此).addClass(“空”);
$(此)。设置动画({
边缘左侧:“15px”
}, 200);
$(此)。设置动画({
marginLeft:“0px”
}, 200);
返回(假);
}
返回(真);
});
$(“#时间范围”)。更改(功能(){
if($(this).hasClass(“空”)){
$(此).removeClass(“空”);
}
});
$('.alertMsg.alert close')。每个(函数(){
$(此)。单击(函数(事件){
event.preventDefault();
$(this).parent().fadeOut(“慢”,函数(){
$(this.css('diplay','none');
});
});
});
$('.tool-tip')。悬停(函数(){
var title=$(this.attr('title');
$(this.data('tipText',title.).removeAttr('title');
$('

).text(title).appendTo('body').fadeIn( “慢”); },函数(){ $(this.attr('title',$(this.data('tipText')); $('.tooltip').remove(); }).mousemove(函数(e){ var mousey=e.pageY+0; var mousex=e.pageX+-20; $('.tooltip').css({ 上图:老鼠, 左:鼠标 }) }); });
Javascript。我关掉了我的,没问题。所以开始看吧。@Banana哇,放松点。我只是想给他指出正确的方向。哈哈,别担心,别生你的气@Christian!谢谢你的帮助@Christian抱歉lol,我并不是想听起来很生气xD“老兄,你不希望他告诉所有他的用户关闭他们的javascript,是吗?”–不,但也许我们希望他首先知道他嵌入的脚本在做什么…?好的,它现在会隐藏密码。但是当你在email address字段中输入了一些东西时。问题又出现了。我明白了,这肯定是别处的问题。我会看一看。嗯,我看不出代码还有什么问题,一定是bootstrap(自定义构建?)或jquery的问题。