Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <div class="searchOption">
  2. <input type="text" id="search" placeholder="search">
  3. </div>
  4. <div class="searchFound">
  5. <!--upon hitting enter, this div opens collapse. -->
  6. </div>
  7.  
  8. /*Need to get the below search code working...*/
  9. var thePage = $(".pageContainer");
  10. $("#search").keyup(function(){
  11. var input = $(this).val();
  12. console.log(input);
  13. //if match found, make corresponding div link appear in open collapsible div,
  14. // else say nothing found in open collapsible div
  15. thePage.each(function(index, value){
  16. var foundText = $(this).text().toLowerCase();
  17. $(value).toggle(foundText.indexOf(input) >= 0);
  18. });
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement