日期:2014-05-16  浏览次数:20438 次

jQuery获取动态增加的span的值的和
我上传图片的时候要根据选择的文件得到文件的大小,要获取所有文件的大小的总和,动态改变的
C# code

queue = '#' + jQuery(this).attr('id') + 'Queue';
jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
                                <span class="fileName" style="margin-right:200px;">' + fileName + '</span>\
                                <span class="byteSize" style="margin-left:90px;">' + byteSize + suffix + '</span>\
                                <span style="margin-left:100px;">等待上传...</span>\
                                <span style="margin-left:80px;"><a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a></span>\
                                <span class="percentage"></span>\
                            </div>');


选择一张图片就增加一个div,我要得到byteSize的值的和,请问怎么获取?

------解决方案--------------------
楼主参考下~
HTML code

上传文件总大小<input type="text" id="fileSize"></br>
<input type="file" onchange="fn(this)">