title: jquery check if string has been deleted from textarea and remove option from select
body: <p>Hi I am using jquery to detect an @ symbol been inserted into a textarea. When this is detected an ajax request is fired to the server to retrieve a list of users. A user would then click on the username and it will be appended to the textarea as follows and also added to a select so that I may notify the relevant users of this note;</p>
  
  <pre><code>$(document).on('click', '#fetchUsers li',function(e){
          var username = $( this ).text();
          var user_id = $( this ).attr('data-user-id');
          $('textarea.addNote').val(function(_, val){return val + username; });
          $(this).parent('ul#fetchUsers').html('');
  
          $('#addAUsertoNote')
              .append($("&lt;option&gt;&lt;/option&gt;")
                  .attr("value",user_id)
                  .text(username));
  
      });
  </code></pre>
  
  <p>Now the problem I have is that if I delete the string @userone from the textarea this option value is in the options list but it shouldn't be. Does anyone know if and how it is possible check if a username has been deleted and remove this from the option group? </p>