JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.2.2.js"></script>
<input type="text" id="caption" />
JavaScript
$(document).ready(function(){
$('#caption').on('keypress', function () {
var n = $(this).val();
if(n.indexOf("#") > -1){
window.alert("There's a hash");
}else{
window.alert("There's not a hash");
}
});
});