I am having an annoying bug that I forgot why it happens:
I have an ordinary html list
<ul> <li>Some text</li> <li>Another Text </li> <li>text</li> <li>another one</li> </ul>
and I am trying to measure each li width
I was trying to write this jQuery code:
for (var i=0; i++; i <4)
{
$("ul li")[i].width();
}
but somehow that doesn’t work – what am I doing wrong in this sentence $("ul li")[i].width(); ?
This is far more simple to walk over a set of elements with the
.each()function.