Guest User

Untitled

a guest
Jan 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. var clickTarget = 2;
  2. $("button").click(function () {
  3. var selector = "." + clickTarget.toString();
  4. $(selector).css("display","inherit");
  5. $(selector).show();
  6. clickTarget++;
  7. });
  8.  
  9. <html>
  10. <head>
  11. </head>
  12. <body>
  13. <div class="row">hi</div>
  14. <div class="row hidden">hi2</div>
  15. <div class="row hidden">hi3</div>
  16. <button>Add Row</button>
  17. </body>
  18. </html>​​​
  19.  
  20. $(document).ready(function(){
  21. $(".hidden").hide();
  22. $("button").click(function () {
  23. $(".row.hidden").eq(0).css("display","inherit");
  24. $(".row.hidden").eq(0).removeClass('hidden').show();
  25. });
  26. });​
  27.  
  28. $("button").click(function () {
  29. $(".2").show();
  30. $('button').unbind('click').click(function(){
  31. $('.3').show();
  32. });
  33. });
  34.  
  35. $(document).ready(function() {
  36. $("button").click(function() {
  37. $(".hidden").first().removeClass('hidden');
  38. });
  39. });​
  40.  
  41. $('button').on('click', function() {
  42. $row = $('div.row:first').clone();
  43. $('div.wraper').append($row);
  44. });
Add Comment
Please, Sign In to add comment