답변 3개
채택된 답변
+20 포인트
마르스컴퍼니
Expert
2년 전
<form>
<input type="text" id="t_sample">
</form></p>
<p>
<script>
$("#t_sample").keydown(function (e) {
if (e.keyCode == 13) {
f_sample();
e.preventDefault();
}
});</p>
<p> </p>
<p>function f_sample() {
alert('!!');
}
</script>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
s
sinbi
2년 전
실행결과보기: https://codepen.io/sinbi/pen/XWoMwdP
댓글을 작성하려면 로그인이 필요합니다.
2년 전
</p>
<p><script>
function fchk(frm) {
// return confirm('confirm or cancel');
var cf = confirm('confirm or cancel');
if (cf == true) {
alert('confirm');
return true;
} else {
alert('cancel');
return false;
}
}
</script></p>
<p> </p>
<p><form onsubmit="return fchk(this)">
<input type="text" name="txt">
</form></p>
<p>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
s
sinbi
2년 전
실행결과보기: https://codepen.io/sinbi/pen/yLGMWNp
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인