Sunday, May 26, 2013

Kode Input HTML

Sebelumnya kita sudah membahas tentang pengertian html dan masukan/input dalam sebuah form, nah sekarang kita akan membahas tentang kode input HTML -nya.

kode input HTML


   1. Text

<html>
<head>
<title>TEXT</title>
</head>
<body>
<form>
Nama depan :
    <input type="text" name="firstname"><br>
Nama belakang:
    <input type="text" name="lastname">
</form>
</body>
</html>


   2. Tombol Radio

<html>
<head>
<title>Radio</title>
</head>
<body>

<form>
    <input type="radio" checked name="sex">Laki-laki<br>
    <input type="radio" checked name="sex">Perempuan<br>
</form>
</body>
</html>


   3. Checkbox

<html>
<head>
<title>Checkbox</title>
</head>
<body>
Saya suka buah:

<form>
    <input type="checkbox" name="Tomat">Tomat<br>
    <input type="checkbox" name="Apel">Apel
</form>
</body>
</html>


   4. Dropdown

<html>
<head>
<title>Dropdown</title>
</head>
<body>
Merk mobil yang anda suka:

<form>
    <select name="cars">
    <option value="Volvo">Volvo
    <option value="Audi">Audi
    <option value="Ferarri">Ferarri
    </select>
</form>
</body>
</html>


   5. Image

<html>
<head>
<title>Image</title>
</head>
<body>

<form>
    <input type="image" src="submit.gif" name="image" width="60" heigth="60"<br>
</form>
</body>
</html>


   6. Button
        a. Submit

<html>
<head>
<title>Button</title>
</head>
<body>

<form name="input" action ="html_form_action.asp" method="get">
    <input type="text" name="firstname" value="Enter your name here !"><br>
    <input type="submit" value="submit">
</form>
</body>
</html>


       b. Reset

<html>
<head>
<title>Button</title>
</head>
<body>
<form name="input" action ="html_form_action.asp" method="get">
    <input type="text" name="firstname" value="Enter your name here !"><br>
    <input type="submit" value="submit">
    <input type="reset" value="reset">
</form>
</body>
</html>


   7. Text Area

<html>
<head>
<title>Text Area</title>
</head>
<body>
<form>
    <textarea rows="10" cols="30">Contoh Text Area</textarea>
</form>
</body>
</html>

No comments:

Speak Your Mind

Silahkan Berkomentar Dengan Kata-Kata yang Sopan

Powered By Blogger · Designed By Seo Blogger Templates