Page 101 - modular_v2.0_HTML&_CSS_Fb
P. 101

Let us create a web page to display the radio button.

                 <!DOCTYPE HTML>
                 <HTML>
                 <HEAD>
                 <TITLE>Form</TITLE>

                 </HEAD>
                 <BODY>
                 <FORM>
                                                                                 Adding radio buttons
                 Gender :
                 <INPUT TYPE="RADIO" NAME="Gender" VALUE="Male" CHECKED/> Male
                 <INPUT TYPE="RADIO" NAME="Gender" VALUE="Female"/> Female
                 </FORM>
                 </BODY>
                 </HTML>
                 Adding a Checkbox


                 A checkbox is like a toggle switch where users can select a desired choice by clicking on the
                 checkbox.
                 Syntax:
                 <INPUT TYPE="CHECKBOX" NAME="Name of check box" VALUE="value of check
                 box">

                 For example:
                 <INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading" CHECKED/>

                 TYPE="CHECKBOX" indicates that the form element is check box.
                 NAME="Hobbies" is the name of the check box.
                 VALUE="Reading" is the default value of check box.

                 CHECKED attribute selects the specific check box by default.
                 Let us create a web page to display the check box.

                 Let us create a web page to display the checkbox.
                 <!DOCTYPE HTML>
                 <HTML>
                 <HEAD>
                 <TITLE>Form</TITLE>
                 </HEAD>

                 <BODY>
                 <FORM>
                 Hobbies :- <BR/>
                 <INPUT TYPE="CHECKBOX" NAME="Hobbies" VALUE="Reading" CHECKED/>Reading
                 <BR/>

                                                                                                                99
                                                                                               Forms in HTML
   96   97   98   99   100   101   102   103   104   105   106