jquery - Can I reference input:text as an #id? -
i'm looking create "filtering input field" eliminates tiles page don't match input.
so far have this...
html -
<input name="filter" type="text" value="find you're looking for" /> <a href='#' id='b_submit'>submit</a> <article id='johns'>content</article> <article id='bobg'>content</article> <article id='saml'>content</article> <article id='ronaldy'>content</article>
script -
$("#b_submit").click(function() { var filter_text = $('input:text').val(); //this sets filter_text input value $('article:not(??not sue call here??)').fadeout(); //this need help, need call value #id eliminate non-matching articles. });
what's proper syntax this? on complicating simple filtering? help? :d
i think you're looking for:
$('article:not(#'+filter_text+')').fadeout();
Comments
Post a Comment