Could someone explain what's wrong with this snippet?
I'm looking to get the width of all images in a div.
var totalwidth = $("#imagecontainer > img").width();
$("#imagecontainer").width(totalwidth);
sorry, thought it was just a syntax problem
(un)working example here:
http://jsfiddle.net/TZ2nT/3/
the container div does not accept the value for some reason?
display: inline-blockto make the DIV wrap to your image. That way, if people don't have Javascript enabled, it degrades peacefully.