开发者

If I add element first then if I delete that later dynamically I should get an alert. How do I do that?

var a1=document.getElementById("txtbx1");
if(a1.value!="")
{
    alert('Enter Nam开发者_如何学Pythone!!!');
    var lbl1=document.createElement("label");
    var lblTitle1=document.createElement("label");
    lblTitle1.innerHTML='Name:';
    label.appendChild(lblTitle1);
    var txt1=document.getElementById("txtbx1");
    var txt11=txt1.value;
    lbl1.innerHTML=txt11;       
    label.appendChild(lbl1);
}

Here I am comparing if the value of that text box is NULL, but it's wrong when it's deleted from form by user..so please help that how to write condition to check its deletion.


do it this way:

if (a1 == null) 
{
 /// ....   
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜