You can poll the input value. It will be less efficient and less responsive, but potentially more reliable.
As you pointed out, the keyup event should not fire when the input value is reset. What if they select the text with the mouse, right-click and cut?
A change event may help, but it is still not so reliable. It only works when blurring and skips some changes (for example, choosing autocomplete).
Here's jsFiddle demonstrating the polling solution.
In response to Eng.Fouad's comment, here's how to add JS:
You can put it in a script tag, for example:
<script type="text/javascript"> </script>
This will work, but it will mean that your custom browser will not cache JavaScript, which means that loading your page will take longer. In addition, you can clear your scripts from your content. But if you need a quick and easy option, this should be done. Put this at the bottom of your body and wrap it in a dom handler (see Bottom of the answer).
As a cleaner option, you can put it in an external file, for example. someScript.js whose contents will be your JavaScript (without script tags). You then link to this script from your HTML file:
<html> <head></head> <body> <script type="text/javascript" src="/path/to/someScript.js"></script> </body> </html>
Note. You need to make the script website available so that browsing at http://www.your-site.com/path/to/someScript.js accesses the script.
The script tag is at the bottom of the body so that the page first loads the actual content, and then the scripts. This will mean that your content will be shown to your users earlier.
You must make the latest JavaScript modification to jsFiddle. JsFiddle has code run by "onDomReady" (see top left of the fiddle). Technically, you don't need to do this if you have a script after your content. This is there to ensure that the script runs after loading the contents, so if the script tries to find elements in the DOM, they are loaded and found. You should probably add this to the script in the case (for some reason) you move the script to the content. To wrap your script in a dom handler in jQuery do the following:
$(function(){
In this example, the code marked where the comment //my code will be launched only when the page is ready.