When click yourBtn, the functions work but not till the end at IE? Chrome is OK!! Where exactly I am wrong?
<input type="button" class='butons_hello_divekle' name="yourBtn" id="yourBtn" onclick="getFile()"/>
function getFile(){
$("#upimgfile").click();
}
function sub(obj){
var file = obj.value;
var fileName = file.split("\\");
alert(fileName.length);
alert(fileName);
alert(fileName[fileName.length-1]);
//it works till this line at IE
$("#yourBtn").html(fileName[fileName.length-1]);
alert("fn: "+fileName[1]);
$("#imgekleform").submit();
alert("submited: "+obj.value);
event.preventDefault();
}
<form action="" method="POST" enctype="multipart/form-data" id="imgekleform" name="imgekleform">
<div style='height: 0px;width: 0px; overflow:hidden;'>
<input id="upimgfile" name="upimgfile" type="file" value="upload" onchange="sub(this)"/></div>
</form>