title: Create "tag" from text
body: <p>I need to create kind of <em>tag</em> for each item in a loop. The idea is to click on each item separately and them allow to make a AJAX request but certainly I have not idea to achieve this. I am using Bootstrap as CSS framework so maybe that's help a bit. The pics below belongs to a Bootstrap alert element:</p>
  
  <p><a href="https://i.stack.imgur.com/pp3En.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pp3En.png" alt="enter image description here"></a></p>
  
  <p>But is pretty much what I want to achieve. Let's take this simple PHP loop as example:</p>
  
  <pre><code>for ($i = 0; $i &lt; 10; $i++)
  {
      echo '&lt;span class="label"&gt;Item '. $i .'&lt;/span&gt;';
  }
  </code></pre>
  
  <p>How do I wrap each ItemN in a simple element and add a X icon or symbol so I can click on it and make a AJAX request for delete that item? Can any give me some help?</p>