I did it here. Hope this helps.
$('#input').keyup(function() {
if ($('#input').val() == 'F') {
$('#ball').addClass('shown');
} else {
$('#ball').removeClass('shown');
}
});
.ball {
background-color: red;
border-radius: 100%;
height: 50px;
width: 50px;
margin-top: 50px;
display: none;
}
.ball.shown {
display: block;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="input" type="text">
<div id="ball" class="ball"></div>
Run codeHide resultAlso the problem with your code is that
if (textInput = "F")
should be
if (textInput == "F")
both in comparison and you have to change
$ (this) .val () trim.toLowerCase () ;.
to
$ (this) .val ()
, "F" , "f".
, , , . , .