0% found this document useful (0 votes)
81 views

HTML Form Tag

The document provides examples of various HTML form elements and tags for text input, passwords, submit buttons, radio buttons, drop down lists, text areas, buttons, and data lists. It also defines block level elements as taking up the full width of the page and creating a new line, while inline elements take up only as much width as needed and do not create a new line. Examples are given of block level elements like divisions, headings, paragraphs, lists and tables. Inline elements examples include spans, anchors, strong, emphasis and images.

Uploaded by

Coeram Con
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

HTML Form Tag

The document provides examples of various HTML form elements and tags for text input, passwords, submit buttons, radio buttons, drop down lists, text areas, buttons, and data lists. It also defines block level elements as taking up the full width of the page and creating a new line, while inline elements take up only as much width as needed and do not create a new line. Examples are given of block level elements like divisions, headings, paragraphs, lists and tables. Inline elements examples include spans, anchors, strong, emphasis and images.

Uploaded by

Coeram Con
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Contoh Tag HTML

Form text
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>

Password
<form>
User name:<br>
<input type="text" name="username">
<br>
User password:<br>
<input type="password" name="psw">
</form>

Submit
<form action="action_page.php">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>

Radio Button
<form>
<input type="radio" name="sex" value="male" checked> Male
<br>
<input type="radio" name="sex" value="female"> Female
</form>
Drop down list

<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>

Text Area
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>

Button
<button type="button" onclick="alert('Hello World!')">Click Me!</button>

Data List
<form action="action_page.php">
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
</form>
Block
Mengambil seluruh lebar halaman, selalu membuat baris baru

Inline
Mengambil seluruh lebar halaman secukupnya dan tidak membuat baris baru

Contoh Blok Level


<div>
Your general-purpose box
<h1> … <h6>
All headings
<p>
Paragraph
<ul>, <ol>, <dl>
Lists (unordered, ordered and definition)
<li>, <dt>, <dd>
List items, definition list terms, and definition list definitions
<table>
Tables
<blockquote>
Like an indented paragraph, meant for quoting passages of text
<pre>
Indicates a block of preformatted code
<form>
An input form
Contoh Inline

<span>
Your all-purpose inline element
<a>
Anchor, used for links (and also to mark specific targets on a page for direct linking)
<strong>
Used to make your content strong, displayed as bold in most browsers, replaces the
narrower <b> (bold) tag
<em>
Adds emphasis, but less strong than <strong>. Usually displayed as italic text, and
replaces the old <i> (italic) tag
<img />
Image
<br>
The line-break is an odd case, as it’s an inline element that forces a new line. However, as
the text carries on on the next line, it’s not a block-level element.
<input>
Form input fields like
Text fields
and
<abbr>
Indicates an abbr. (hover to see how it works)
<acronym>

You might also like