私はこのコードを持っています:
function beforemouseout() {
if ($(this).val() == '') {
$(this).val($(this).attr('title'));
}
else {
}
setTimeout('beforemouseout()',3000);
}
$(".other").click(function() {
$(this).val('');
$(".other").mouseout(beforemouseout);
});
<input id="hour" type="text" class="other" autocomplete="off" value="hour" title="hour" />
<input id="hour" type="text" class="other" autocomplete="off" value="minutes" title="minutes" />
しかし、Firebug はエラーを出します: beforemouseout が定義されていません。なんで?jsfiddle.netで試してみましたが、エラーは発生しませんでしたが、結果は期待したものではありません.#hourをクリックしてテキストを非表示にし、onmouseoutがトリガーされて5秒待ってから-にチェックを行う