如何从文本框中删除(空)文本?

时间:2010-08-10 11:00:13

标签: php ajax

如何从像

这样的文本框中删除文本
elseif($num_rows >= 1)
{
?>
    <script>
        document.getElementById("newid").value="";
    </script>
<?php
echo "<font color='Red'><b>$logid</b> Ligin name has already been taken, Please chose another Login name.</font>";
}

这个代码我通过ajax使用,但这不起作用。 newid id text box control id on php login page

1 个答案:

答案 0 :(得分:0)

我想你想将innerHTML设置为空而不是值:

document.getElementById("newid").innerHTML="";
相关问题