hi i have javascript issue that i wrote a input when i change it text to sadra it doesn't alert "your text contains "sadra" word " how can i resolve it ? thanks for helping ...
here is the code:
var realText;
function text(realText) {
var realText = document.getElementById('input1').innerHTML;
if (realText.includes('sadra')) {
alert("your text contains \"sadra\" word ");
}
}
<label>Input :</label>
<input type="text" name="test" id="input1" onchange="text(realText)" />