JSFiddle - React, Tailwind, and code Playground

by yijiang

HTML

<input type="text" id="text" />
<div id="apples">Apples</div>

JavaScript

$('#text').bind('input', function(){
    if(this.value.indexOf('apples') === -1){
        $('#apples').hide();
    } else {
        $('#apples').show();
    }
});