English 中文(简体)
j 甄选中的质量选择
原标题:jQuery selection within selection
  • 时间:2011-11-22 16:43:54
  •  标签:
  • jquery
 $( #addrow ).click(function(){
     $( input ).not( :visible ).slice(0,1).addClass( required );
     $( .row ).not( :visible ).first().removeClass( hide ); 
 }

我想$(投入).not(:visible ) selected only [ within $(row ).not(:visible )

我如何把这两条加在一起,以履行第1条职能? 感谢!

最佳回答

为此:

$( .row:hidden input:hidden ).slice(0,1).addClass( required );

也可参看I ve 使用的:hidden 选任人,相当于.not(”:visible”

问题回答

你们可以把挑选者同起来:

$( .row ).not( :visible ).find( input ).not( :visible ).slice(0,1).addClass( required );

我不敢肯定我是否正确理解这个问题,但应当努力:

//if the input has the row class
$("input.row:not(:visible)").slice(0,1).addClass("required");

//if the input is contained within an element using the row class
$(".row:not(:visible) input").slice(0,1).addClass("required");




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签