Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 웹개발
- Eclipse
- Firebase
- restapi
- spring
- myBatis
- 코딩
- SQLD
- AJAX
- CSS
- 배포
- 기업설명회
- jsp
- 티스토리챌린지
- 오블완
- SQL
- github
- vscode
- 깃허브
- JavaScript
- bootstrap
- 스파르타코딩클럽
- jQuery
- error
- HTML
- java
- ChatGPT
- 자바
- Spring Security
- 이클립스
Archives
- Today
- Total
푸들푸들
이메일 유효성 검사 본문
email@emil.com 형식 검사 (<body>는 일부만)
<script>
function validateEmail() {
const emailInput = document.getElementById('email').value;
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; // regex: 정규표현식(Regular Expression)
if (!regex.test(emailInput)) {
alert("이메일 형식을 확인하세요(email@email.com)");
}
} // -> <button onclick="validateEmail()"> onclick: 버튼에 함수 연결
</script>
<body>
<table>
<tr>
<td>Email</td>
<td>
<input type="email" name="email" id="email">
<button onclick="validateEmail()">Email 검사</button>
</td>
</tr>
</table>
<body>
<button onclick="validateEmail()"> onclick: 버튼에 함수 연결
'구디아카데미 > JAVA' 카테고리의 다른 글
제목 CSS (1) | 2024.11.04 |
---|---|
1104 동적 Update문 (0) | 2024.11.04 |
1104 [Sakila] addStaff.jsp (0) | 2024.11.04 |
Github 잔디 (4) | 2024.11.02 |
Spring 설치 (1) | 2024.11.02 |