Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <tr>
  2. <td><input type="Checkbox" name="check"/></td>
  3. <td>random text1</td>
  4. </tr>
  5. <tr>
  6. <td><input type="Checkbox" name="check"/></td>
  7. <td>random text 2</td>
  8. </tr>
  9. <tr>
  10. <td><input type="Checkbox" name="check"/></td>
  11. <td>random text 4</td>
  12. </tr>
  13.  
  14. var selectedArray = [];
  15. var selected = new Object();
  16. $('input[type=checkbox]').each(function () {
  17. selectedAttributes = $(this).closest('td').next().html();
  18. if (this.checked)
  19. searchAttibutes.push(selectedAttributes);
  20. });
  21.  
  22. //o/p [random text1,random text 2] -- assuming first 2 checkbox selected
  23.  
  24. var selectedArray = [];
  25. var selected = new Object();
  26. $('input[type=checkbox]').each(function () {
  27. selectedAttributes.random = $(this).closest('td').next().html();
  28. if (this.checked)
  29. searchAttibutes.push(selectedAttributes);
  30. });
  31.  
  32. //o/p [Object { random="random text 4"}, Object { random="random text 4"}] -- assuming first 2 checkbox selected
  33.  
  34. selectedAttributes = $(this).closest('td').next().html();
  35.  
  36. selectedAttributes.random = $(this).closest('td').next().html();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement