사실 첫번째 submit은 버튼이지만 css style로 hyperlink처럼 바꾼 모습이고,
두번째 submit버튼모양은 사실 hyperlink지만 css style로 버튼마냥 바꾼 모습니다.
적용에 사용된 소스는 아래:
<!DOCTYPE html>
<html>
<head>
<style>
a.button {
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
}
input.submitLink {
background-color: transparent;
text-decoration: underline;
border: none;
cursor: pointer;
}
</style>
<script>
function formSubmit()
{
document.getElementById("frm1").submit();
}
</script>
</head>
<body>
<form action="test1.jsp" method="get">
name: <input type=text name="name">
phone: <input type=text name="phone">
<input type=submit value="submit" class="submitLink">
</form>
<form id="frm1" action="test2.jsp" method="get">
name: <input type=text name="name">
phone: <input type=text name="phone">
<a href=# class="button" onclick="formSubmit(); return false;">submit</a>
</form>
</body>
</html>
댓글
댓글 쓰기