Advertisement
sazid_iiuc

Untitled

Apr 23rd, 2021
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let form = document.querySelector('#locationBox');
  2.  
  3. let myBtn = document.querySelector('#addLocation');
  4. console.log(myBtn);
  5.  
  6.  
  7. const myHTML = `<div id="locationBox">
  8. <div class="form-group">
  9.     <select class="form-control"  style="border: none; border-bottom: 2px solid;">
  10.       <option>GP Records</option>
  11.       <option>Hospital Records</option>
  12.       <option>X-rays</option>
  13.       <option>Physiotherapy Records</option>
  14.       <option>Walk in Records</option>
  15.       <option>Dental Records</option>
  16.       <option>Counselling Records</option>
  17.       <option>Employment Records</option>
  18.       <option>Miscellaneous Records</option>
  19.     </select>
  20.   </div>
  21.  
  22.   <input type="text" class="form-control" placeholder="Location Name" style = "margin-top:30px; border: none; border-bottom: 2px solid;" required>
  23.  
  24.   <div class="form-group">
  25.       <textarea class="form-control"  style = "margin-top:30px; border: none; border-bottom: 2px solid;" placeholder="Address" rows="3" required></textarea>
  26.   </div>
  27.  
  28.   <input type="number" class="form-control" placeholder="Post Code" style = "margin-top:30px; border: none; border-bottom: 2px solid;" required>
  29.  
  30.   <div class="form-group">
  31.       <textarea class="form-control"  style = "margin-top:30px; border: none; border-bottom: 2px solid;" placeholder="Additional Notes" rows="3" required></textarea>
  32.   </div>
  33.  
  34.   <button type="button" class="btn btn-primary"  style="border: none; background-color : #6C63FF; float: right; margin : 10px;">Add Location</button>
  35.  
  36.  
  37. </div>`;
  38.  
  39.  
  40.  
  41. const addBtn = myBtn.addEventListener('click', () => {
  42.     console.log(Array.from(myBtn).length);
  43.     console.log('working');
  44.     form.insertAdjacentHTML("beforeend", myHTML);
  45.  
  46. })
  47.  
  48.  
  49.  
  50. // getID('addLocation').addEventListener('click', () => {
  51.  
  52.  
  53.  
  54.  
  55. //     var divC = getID('locationBox');
  56. //     divC.insertAdjacentHTML("beforeend", myHTML);
  57. //     console.log("hello")
  58. // })
  59.  
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement