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

时间:2022-11-13 19:55:08

how to remove text from a text box like-

如何从文本框中删除文本,如 -

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>";
}

this code I am using through ajax but this is not working. newid id text box control id on php login page

这个代码我通过ajax使用,但这不起作用。 php登录页面上的newid id文本框控件ID

1 个解决方案

#1


0  

I guess you like to set innerHTML to empty instead of value:

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

document.getElementById("newid").innerHTML="";

#1


0  

I guess you like to set innerHTML to empty instead of value:

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

document.getElementById("newid").innerHTML="";