Answer the question
In order to leave comments, you need to log in
How to decline number of upload.files.length?
Hello. Please look at the code.
function declOfNum(number, titles)
{
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
function get_files() {
var upload = document.getElementById('fileFF');
var resultat = declOfNum(upload.files.length,['файл','файла','файлов']);
$('#pupl').text('Вы выбрали' + resultat);
}
function get_files() {
var upload = document.getElementById('fileFF');
$('#pupl').text('Вы выбрали' + upload.files.length + ' файл');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question