I'm trying to clear a value in a textbox whenever i click the clear button. But i keep on getting a syntax error expected "=" in the line document.getElementByid. Is my code wrong?
<?php
function clear(){
document.getElementByid('textinput').value="";
}
if (isset($_POST['textinput'])){
echo $_POST['textinput'];
}
if (isset($_POST['clear'])){
clear();
}
?>
<form action="index.php" method="post">
<input type="text" name="textinput">
<input type="submit" value="Post" name="post">
</form>
<input type="submit" value="Clear" name="clear">