Guest User

Untitled

a guest
Aug 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $( document ).ready(function () {
  2.  
  3. var clone = (function () {
  4. var cloneIndex = 0;
  5. var template = $('#categoryTemplate').text();
  6.  
  7. return function () {
  8. return template.replace(/ID/g, ++cloneIndex);
  9. }
  10.  
  11. })();
  12.  
  13.  
  14. //Start off with 1 category.
  15. categories.append(clone());
  16.  
  17.  
  18. $(document).on('change', 'select', function () {
  19.  
  20. var string= '';
  21.  
  22. $.each($('select option:selected'), function () {
  23.  
  24. string += $(this).val();
  25.  
  26. });
  27.  
  28. document.getElementById("MainContent_Label1").innerHTML = string;
  29. });
  30.  
  31.  
  32. $(document).on("click", 'button.add', function () {
  33.  
  34. categories.append(clone());
  35.  
  36. });
  37. });
Add Comment
Please, Sign In to add comment