Advertisement
Guest User

Untitled

a guest
Jun 6th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
  5. </head>
  6.  
  7. <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  8.  
  9. <body>
  10. <div class="col-md-2"></div>
  11. <div class="col-md-7">
  12. <div class="table-responsive">
  13.  
  14. <table id="tableSelect" class="table rowclick table-hover">
  15. <thead>
  16. <tr>
  17. <th scope="col"> Select</th>
  18. <th>Text</th>
  19. <th>Comment</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr>
  24. <th scope="col">
  25. <input type="radio" name="radios" id="radio1" />
  26. </th>
  27. <th scope="col">text1</th>
  28. <td>comment1</td>
  29. </tr>
  30. <tr>
  31. <th scope="col">
  32. <input type="radio" name="radios" id="radio2" />
  33. </th>
  34. <td>text2</td>
  35. <td>comment2</td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. </div>
  41. <script>
  42. $('#tableSelect tr').click(function() {
  43. $(this).find('th input:radio').prop('checked',true);
  44. })
  45. </script>
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement