웹페이지에서 버튼이나 글자를 클릭하면 다른 화면으로 이동하거나 새 탭에 링크를 여는 기능이 필요할 때가 있다. 찾아보니 <a>
태그나 <button>
를 사용할 때 방법이 약간 달라서 정리해둔다.
How to Add an HTML Button that Acts Like a Link
<a href="https://velog.io/@lee_yesol421">내 velog</a>
<button onclick="window.location.href='https://velog.io/@lee_yesol421';" type="button">내 velog</button>
<a href="https://velog.io/@lee_yesol421" target="_blank">내 velog</a>
<form action="https://velog.io/@lee_yesol421" method="get" target="_blank">
<button type="submit" >내 velog</button>
</form>