I tried
$(":input:not(input[type=button],input[type=submit],button):visible:first")
但它什么也没找到.
What is my mistake?
UPD: I execute this on $(document).load()
<script type="text/javascript">
$(window).load(function () {
var aspForm = $("form#aspnetForm");
var firstInput = $(":input:not(input[type=button],input[type=submit],button):visible:first", aspForm);
firstInput.focus();
});
</script>
and in the debug I can see that firstInput is empty.
UPD2:
到目前为止,我已经发现,对于某些元素,它确实可以找到它们(对于固定的元素),而对于某些元素,则不能:(