Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. $('.tooltip[id*="_UI_A_"]').each(function(){
  2. console.log(this.getAttribute('id'));
  3. });
  4.  
  5. P2000_UI_A_5000_0
  6. P2000_UI_A_5000_1
  7. P2000_UI_A_5000_2
  8. P2000_UI_A_5000_3
  9. P2000_UI_A_5065
  10. P2000_UI_A_5100
  11.  
  12. P2000_UI_A_5000
  13. P2000_UI_A_5065
  14. P2000_UI_A_5100
  15.  
  16. var allIds = $('.tooltip[id*="_UI_A_"]').map(function () {
  17. return this.id.split('_').slice(0, 4).join('_');;
  18. }).get();
  19.  
  20. var uniqueIds = $.grep(allIds,function(v,k){
  21. return $.inArray(v,allIds) === k;
  22. });
  23.  
  24. $.each( uniqueIds, function(index, value){
  25. // do what you want with value
  26. console.log(value);
  27. });
  28.  
  29. $.unique( $('.tooltip[id*="_UI_A_"]').map(function(){
  30. return (this.id.split('_').slice(0,4).join('_');
  31. }).get() );
  32.  
  33. $('.tooltip[id*="_UI_A_"]:not(radio)').each(function(){
  34. console.log(this.getAttribute('id'));
  35. });
  36.  
  37. $('.tooltip[id*="_UI_A_"]').filter(function(){
  38. return this.id && this.id.match(/_UI_A_d+$/);
  39. });
  40.  
  41. var ids = [];
  42. $('.tooltip[id*="_UI_A_"]').each(function(){
  43. if (this.id && this.id.match(/_UI_A_d+$/)) {
  44. ids.push(this.id);
  45. }
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement