i'm getting jquery , having problems understanding is. how can use array style indexing on jquery object jquery not array? javascript thing?
<ul id="myul"> <li></li> <li id="second"></li> <li></li> </ul> var jqueryobject = $("#myul > li"); alert(jqueryobject[1].attributes.getnameditem("id").value); if (jqueryobject instanceof array) { alert('value array!'); } else { alert('not array');//this pops }
a jquery collection object properties numbered array indexes (and other properties , methods), each holding 1 of matched elements. given length property tell how many elements selector matched. see http://api.jquery.com/types/#jquery
also, yes, partly javascript thing--js lets access object's properties dot notation or square-bracket notation.
Comments
Post a Comment