<script>
$(function () {
var citys = $("#city li")
for (var i = 0; i < citys.length; i++) {
alert(i+":"+citys[i].innerHTML);
}
citys.each(function () {
alert(this.innerHTML)
alert($(this).innerHTML)
});
citys.each(function (index, element) {
alert(index + ":" + element.innerHTML);
alert(index + ":" + $(element).html());
});
$.each(citys, function () {
alert(this.innerHTML)
alert($(this).html());
})
$.each(citys,function (index,element) {
// alert(index + ":" + element.innerHTML);
alert(index + ":" + $(element).html());
});
});
</script> |
|