In the code below, I want to show the size of uploaded file in a div or label element. However, it doesn't work when I want to show it in an input element.
<script>
var maxfilesize = 2097152;//2MB;
$('#fuAttachments').live("change", function () {
$("#msg").text("");
var tt = $(this).val();
var size = this.files[0].size;
$("#msg").append(Math.ceil(size / 1024));
});
</script>
<input id="fuAttachments" type="file" />
I want to display the size of uploaded file in #msg
<input id="msg" type="text" />