1

how to change the text .

how to change the "no file chosen" text in this image Please help to me. thanks & regards chakri

4

1 回答 1

4

我使用 CSS 隐藏默认文本并使用标签显示新文本。看看 - http://jsfiddle.net/ZDgRG/

选择文件
input[type=file]{
    width:90px;
    color:transparent;
}

window.pressed = function(){
    var a = document.getElementById('aa');
    if(a.value == "")
    {
        fileLabel.innerHTML = "Choose file";
    }
    else
    {
        var theSplit = a.value.split('\\');
        fileLabel.innerHTML = theSplit[theSplit.length-1];
    }
};
于 2013-09-12T10:35:37.843 回答