Press "Enter" to skip to content

Input Components Examples in HTML

Last updated on October 4, 2019

Definition :

  • These are the components which are meant for taking the input as well as displaying the  output on the webpage.

Program :

<html>

     <body>

                     <input type=”text”/> <br>

                                 <input type=”text” readonly/> <br>

                                 <input type=”text” value=”enter some value”/> <br>

                                 <input type=”text” value=”enter some value”/> <br>

                                 <input type=”text” maxlength=”5″/> <br>

                 </body>

</html>

How to create a form

Program :

<html>

    <body bgcolor=”green” background=”Dessert.jpg”>

                     <input type=”text” value=”testing”/> <br>

                                 <input type=”password” placeholder=”password”/> <br>

                                 <input type=”hidden” value=”text”/> <br>

                                 <input type=”date”/> <br>

                                 <input type=”color”/> <br>

                                 <input type=”button” value=”button”/> <br>

                                 <input type=”submit” value=”submit”/> <br>

                                 <input type=”reset” value=”reset”/> <br>

                                 <input type=”radio”/> Select gender <br>

                                 <input type=”check box”/> MCA <br>

                                 <select>

                                     <option value=”A”> A </option>

                                                 <option value=”B”> B </option>

                                                 <option value=”C” selected> C </option>

                                                 <option value=”D”> D </option>

                                                 <option value-“E”> E </option>

                                                 </select> <br>

                                                 <textarea rows=”10″ cols=”10″> </textarea> </br>

                                                 <button> Click me </button> </br>

                </body>

</html>

Sample Program :

<html>

     <frameset rows=”20%,60%,20%” bordercolor=”red” frameborder=”1″>

                      <frame src=”header1.html” noresize/>

                                      <frameset cols=”20%,60%,20%” bordercolor=”red” frameborder=”1″>

                                                      <frame src=”img1.html” noresize/>

                                                                  <frame src=”reg1.html” noresize/>

                                                                  <frame src=”img2.html” noresize/>

                                                  </frameset>

                                  <frame src=”footer1.html” noresize/>

                 </frameset>

</html>

Header1.html:

<h1>

   <center> Header</center>

</h1>

Footer1.html :

<h1>

   <center> Footer </center>

</h1>

Img1.html :

<html>

   <body>

       <marquee direction=”up”> <center>

               <img src=”Lighthouse.jpg” width=”100″ height=”100″ title=”view image” alt=”sorry for inco”/>

               </center>  </marquee>

            </body>

</html>

Img2.html :

<html>

   <body>

       <marquee direction=”down”> <center>

               <img src=”Lighthouse.jpg” width=”100″ height=”100″ title=”view image” alt=”sorry for inco”/>

               </center>  </marquee>

            </body>

</html>

Reg1.html :

<html>

    <body>

                <center>

                            <input type=”username” placeholder=”username”/> <br>

                                    <input type=”password” placeholder=”password”/> <br>

                                    <input type=”submit” value=”login”/> <br>

                                    <input type=”reset” value=”cancel” <br>

                        </center>

            </body>

</html>

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *