Category: 1. HTML Misc

  • Html <Button> Type

    The type is an attribute of <button> element, which sets the type of the button as described in the following syntax: Following are the three values of type attribute: Output:

  • HTML Background Image

    The <background> attribute in the HTML document is used to specify the background image on a HTML page or a table. You can pass the path of an image as a value of background attribute to set the image of your HTML page or table. Syntax Examples: The following examples set the background image in different styles: Example 1: This example uses the background attribute…

  • Add JavaScript to HTML

    There are following three ways through which we can add the JavaScript code into the HTML document: Include the JavaScript Code in <head> tag. In this section, you will learn to include the JavaScript code between the <head> and </head> tag. Syntax In the above syntax, the JavaScript code written between the <script>……. </script> tag is put…

  • HTML List Box

    The list box is a graphical control element in the HTML document that allows a user to select one or more options from the list of options. Syntax To create a list box, use the HTML element <select> which contains two attributes Name and Size. The Name attribute is used to define the name for calling the list box, and size attribute is used to specify the…

  • HTML Id Attribute

    The id attribute is used to specify the unique ID for an element of the HTML document. It allocates the unique identifier which is used by the CSS and the JavaScript for performing certain tasks. Syntax Example 1: The following example describes how to use the id attribute in CSS document: Output: Example 2: The following example describes how to use the ID…

  • HTML Form Action

    The action is an attribute of <form> element that specifies the url of the second web page. The second page receives the form-data from the first page after the submission of a form. Syntax This attribute specifies the URL of a web page as its value which receives the information of the form filled by the user. Example

  • HTML Date

    The date is the value of the type attribute of an <input> element. It creates a calendar that allows a user to choose the date. The resulting value includes the day, month, and year. Syntax Example 1: The following example describes how to use the date in <input> tag: Output: Example 2: The following example uses the JavaScript code for displaying the date which is entered in…

  • HTML Background-color

    The <bgcolor> is the attribute to set the background color of an HTML element. This attribute is used with the following tags: Syntax: Examples: The following examples use the <bgcolor> attribute in the different tags. Example 1: Use the <bgcolor> attribute with the <body> tag Output: Example 2: Use the <bgcolor> attribute with the <tr> tag Output: Example 3: The following…

  • Html <text> tag

    The Html <text> tag is used to define the single-line text field on a web page. When we set the value text to the type attribute of an input element as shown in the following syntax: Syntax: Example Output: Attributes of HTML Text Tag 1. Size The size attribute is used to define the length of the text field.…

  • HTML Space Code

    There are multiple ways to insert spaces between the words or characters: Using Spacebar To add a space between the words, first we have to click where we want to add a space and then press space bar. The HTML document use only one space between the words. In simple words, if we press spacebar…