title: How do you send a list of a node's children ids using thymeleaf?
body: <p>I have a function that adds badges to a div by selecting items from a dropdown list.</p>
  <p>I'm adding badges using this function added to the dropdown list onclick event:</p>
  <pre><code>function addBadge(parent, badgeId, value){
      var elem = document.getElementById(parent);
  
      var currentTaxiways = elem.children;
      var alreadyExists = false;
  
      for(var i = 0; i &lt; currentTaxiways.length; i++){
          if(badgeId === currentTaxiways[i].id){
              alreadyExists = true;
          }
      }
  
      if(!alreadyExists) {
          var newBadge = document.createElement(&quot;span&quot;);
          newBadge.classList.add(&quot;badge&quot;);
          newBadge.classList.add(&quot;badge-primary&quot;);
          newBadge.classList.add(&quot;bg-secondary&quot;);
  
          newBadge.id = badgeId;
  
          var node = document.createTextNode(value);
          newBadge.appendChild(node);
  
          newBadge.innerHTML += &quot;&amp;emsp;&quot;;
  
          var deleteButton = document.createElement(&quot;a&quot;);
          deleteButton.href = &quot;#&quot;;
          deleteButton.classList.add(&quot;x-btn&quot;);
          deleteButton.onclick = function delBadge() {
              deleteBadge(newBadge.id);
          };
  
          var node2 = document.createTextNode(&quot;X&quot;);
          deleteButton.appendChild(node2);
  
          newBadge.appendChild(deleteButton);
  
          elem.appendChild(newBadge);
      }
  }
  </code></pre>
  
  <p>And the function for deleting the badges is this one:</p>
  <pre><code>function deleteBadge(badge){
      var elem = document.getElementById(badge);
      elem.parentNode.removeChild(elem);
  }
  </code></pre>
  <p>How do I send the list of ids of all the badges added to the div to my controller using thymeleaf when the form is submitted?</p>