我正在創建一個「過濾輸入字段」,用於消除不匹配輸入的頁面中的圖塊。我可以參考輸入:文本是否爲#id?
到目前爲止,我有這個...
HTML -
<input name="filter" type="text" value="Find who 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>
腳本 -
$("#b_submit").click(function() {
var filter_text = $('input:text').val();
//this sets filter_text as the input value
$('article:not(??not sue what to call here??)').fadeOut();
//this is where I need help, I need to call the value as an #id to eliminate non-matching articles.
});
什麼是正確的語法來做到這一點?我是否在簡化過濾?幫幫我? :d
作品...... ROCK ON! – 2013-05-08 17:10:50