43 lines
1.2 KiB
HTML
43 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
<title>form fields</title>
|
|
</head>
|
|
|
|
<body>
|
|
<form>
|
|
<label for="text">
|
|
<input type="text" />
|
|
</label>
|
|
<label for="radio">
|
|
<input type="radio" />
|
|
</label>
|
|
<label for="checkbox">
|
|
<input type="checkbox" />
|
|
</label>
|
|
<label for="textarea">
|
|
<textarea name="" id="" cols="30" rows="10"></textarea>
|
|
</label>
|
|
<label for="select">
|
|
<select name="" id="">
|
|
<option value="1">1</option>
|
|
<option value="2">2</option>
|
|
</select>
|
|
</label>
|
|
<label>
|
|
<input name="tagName" />
|
|
</label>
|
|
</form>
|
|
</body>
|
|
<script>
|
|
document.querySelector('input[type="text"]').value = '1';
|
|
document.querySelector('input[type="radio"]').checked = true;
|
|
document.querySelector('input[type="checkbox"]').checked = true;
|
|
document.querySelector('textarea').value = '1234';
|
|
document.querySelector('select').value = '2';
|
|
</script>
|
|
</html>
|