목차
- <input type="url"> 예제 - http(s) 형식의 URL 주소 입력
- <input type="url"> 정의
- <input type="url"> 구문
<input type="url"> 예제 - http(s) 형식의 URL 주소 입력
<form action="/action_page.php">
<label for="url">http(s) 포함해 URL주소 입력:</label>
<input type="url" id="" name="url"><br><br>
<input type="submit">
</form>
결과보기
<input type="url"> 정의
http(s) 프로토콜 포함한 URL 주소 입력 가능한 INPUT 요소.
1.
- 서버로 데이터가 넘어가기 전에 브라우저에서 유효성 검사.
- http(s) 없이 입력 시, "URL을 입력하세요" 경고 말풍선 뜸.
- http: , http:/ 형식으로 입력해도 정상적인 값으로 간주함.
- <label> 태그도 함게 사용 시, 웹접근성 향상됨.
2.
IE10 이상 주요 최신 브라우저 모두 지원.
3. MDN <input type="url"> 예제보기
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/url
<input type="url"> 구문
<input type="url">