daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var designs = {
  2.     shirt : ['Simple', 'V-Neck', 'Polo'],
  3.     hoodie : ['Sweater', 'Hoodie'],
  4. }
  5.  
  6. function chooseType(type) {
  7.     var btnGroup = document.getElementById('btn-group');
  8.     var btn = document.getElementById('design-btn');
  9.  
  10.     for (k in designs){
  11.         if (type == k) {
  12.             for (i=0; i < designs[k].length; i++) {
  13.                 var clone = btn.cloneNode(true);
  14.                 btnGroup.appendChild(clone);
  15.                 clone.classList.remove('d-none');
  16.                 clone.innerHTML = designs[k][i];
  17.             }
  18.         }
  19.     }
  20. }
  21.      
  22. <div id="design" class="d-none">
  23.     <p>Design da pe├ža:</p>
  24.     <div class="btn-group" role="group" id="btn-group">
  25.         <button onclick="chooseDesign()" type="button" class="d-none" id="design-btn"></button>
  26.     </div>
  27. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top