How to set limit of input file field with jQuery

Hello everyone!

By default in current implement of HTML in modern browsers input tag doesn’t support limit for uploaded files.
And if you need to set limit of maximum upload files in your field:

<input type="file" name="photos" multiple />

you can use simple jQuery snippet:

	var limit_of_files = 5;

			alert('You exceeded limit for uploading files! Maximum of uploading files is 5!');
			return false;