Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="searchOption">
- <input type="text" id="search" placeholder="search">
- </div>
- <div class="searchFound">
- <!--upon hitting enter, this div opens collapse. -->
- </div>
- /*Need to get the below search code working...*/
- var thePage = $(".pageContainer");
- $("#search").keyup(function(){
- var input = $(this).val();
- console.log(input);
- //if match found, make corresponding div link appear in open collapsible div,
- // else say nothing found in open collapsible div
- thePage.each(function(index, value){
- var foundText = $(this).text().toLowerCase();
- $(value).toggle(foundText.indexOf(input) >= 0);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement