Menu ▼

Previous Next

Submit :

Submit button will be used when user input need to be submit to server. For input tag we have to specify the type as "submit", then it will render a Submit button in output.

Syntax :

<input type="submit" />

Example :



    <title>HTML Tutorial</title>

    <script language="javascript">

        function checkcomments() {

            if (document.getElementById("txtComments").value == "") {

                alert("Please enter your comemnts.");

                return false;






    <form action="submit.aspx">


        Please post your comments :<br />

        <textarea id="txtComments" name="txtComments" rows="10" cols="50"></textarea>

        <br />

        <input type="submit" id="btnPost" value="Submit Post" onclick="return checkcomments();" />





Output :
HTML Tutorial
Please post your comments :

Previous Next