Using the input Element to Obtain url
type='url' input element accepts only URL. Additional attributes available for the type='url'
Attribute | Description | New in HTML5 |
---|---|---|
list | the id of a datalist element providing values for the element. | Yes |
maxlength | the maximum number of characters that the user can enter | No |
pattern | a regular expression pattern for input validation | Yes |
placeholder | a hint to the user | Yes |
readonly | If present, makes the text box read-only | No |
required | required for the purposes of input validation | Yes |
size | the width of the element, the number of characters that are visible. | No |
value | the initial value. | No |
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form method="post" action="http://yourServer/form">
<p>
<label for="name"> Name: <input value="Mark" id="name"
name="name" />
</label>
</p>
<p>
<label for="password"> Password: <input type="password"
placeholder="Min 6 characters" id="password" name="password" />
</label>
</p>
<p>
<label for="url"> Your homepage: <input type="url" id="url"
name="url" />
</label>
</p>
<input type="submit" value="Submit Vote" />
</form>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
input Restricted:
- Using the input Element to Restrict Data Entry
- Using the input element to obtain a number
- Using input Element to Obtain a Number in a Given Range
- Using the input Element to Obtain a Boolean Response
- Using the input Element to Create Fixed Choices
- Using the input Element to Obtain email address
- Using the input element to obtain telephone number
- Using the input Element to Obtain url
- Using the input element to obtain times and dates
- Using the input Element to Obtain a Color
- Using the input Element to Obtain Search Terms
- Using the input element to create hidden data items
- Using the input Element to Create Image Buttons and Maps
- Using the input element to upload files
Related: