Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(function(){
  3. $(".styleinput #inputUserfilter").keyup(function(){
  4. var index = $(this).parent().index();
  5. console.log('test');
  6. var nth = "#tableUser td:nth-child("+(index+1).toString()+")";
  7. var valor = $(this).val().toUpperCase();
  8. $("#tableUser tbody tr ").show();
  9. $(nth).each(function(){
  10. if($(this).text().toUpperCase().indexOf(valor) < 0){
  11. $(this).parent().hide();
  12. }
  13. });
  14. });
  15. $("#inputUserfilter").blur(function(){
  16. $(this).val("");
  17. });
  18. });
  19. </script>
  20.  
  21. <div class="styleinput" >
  22. <label>Filtrar: </label>
  23. <input type="text" id="inputUserfilter"/>
  24. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement