<a href="https://naver.com" target="_blank">네이버</a> <a href="https://google.com" target="_blank">구글</a> <script> document.addEventListener("DOMContentLoaded", function() { var allLinks = document.querySelectorAll("a"); allLinks.forEach(function(link) { link.href = "https://homzzang.com"; }); }); </script> 결과보기
<a href="https://naver.com" target="_blank">네이버</a>
<a href="https://google.com" target="_blank">구글</a>
<script>
document.addEventListener("DOMContentLoaded", function() {
var allLinks = document.querySelectorAll("a");
allLinks.forEach(function(link) {
link.href = "https://homzzang.com";
});
</script>
결과보기
PS. jQuery로 구현하기