我有这样的代码
<script src='js.js'></script>
<script>
(function($){
var img = document.getElementsByClassName('x'),
L = img.width(),
T = img.height();
for (var i=0,len=img.length;i<len;i++){
img[i] = $('#u').text("Width" + L + "Height " + T)
}
});
</script>
<div id='image'>
<img class='x' src='1.jpg'/>
<span id='u'></span>
</div>
<div id='image'>
<img class='x' src='5.jpg'/>
<span id='u'></span>
</div>
我想在其中应用图像的文本宽度和高度<span id='u'></span>
但不起作用,