How can JQuery know if the value inside the input is equal to the value inside the span with which it was created and the duplicate value is deleted
for example
<div id="tags-here" style="width: 100%;height: 150px;background-color: rgb(173, 199, 196);">
<input id="make-tags" type="text" class="animated-progress" style="background-color: white;">
</div>
I've only got as far as this and I'm stumped. I have looked on google but I haven't found anything.
$("#make-tags").on("keyup",function(e){
var key = e.keyCode || e.wich,
inpval = $("#make-tags").val(),
va = $(".tag-span").val(),
tinpval = $("#make-tags").text(),
tva = $(".tag-span").text();
if(key === 188 ){ //comma preased
var value = $(this).val().slice(0, -1);
$("#tags-here").append("<span class='tag-span'><i class='fas fa-times'></i>" + value +"</span>")
$(this).val('');
}
$(".tag-span").each(function(){
if( inpval === tva){
console.log("yes")
}else{
console.log("nono")
}
});