在textchange事件中使用javascript显示警报消息 [英] To display alert messge using javascript in textchange event
本文介绍了在textchange事件中使用javascript显示警报消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我想检查在文本框中输入的天数是否超过15天(如果超过该天数),我想向用户显示警告消息,说明如何使用javascript
Hi
I want to check the number of days entered in a text box is not more than 15 days if it exceeds i want to display an alert message to the user how to do it using javascript
推荐答案
尊敬的Shashwath,
看下面的示例代码:
Dear Shashwath,
Look this sample code:
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = document.getelementbyid('txt1');
if (TestVar>15)
{
alert("You entered more then 15 days")
}
}
谢谢
Thanks
这篇关于在textchange事件中使用javascript显示警报消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文