본문으로 바로가기

html button tag가 ie8 에선 안됨.


button 에 id 값을 주고 jquery로 그 버튼을 클릭했을때 페이지이동을 하도록 하는 경우는 잘되지만,

button에 a tag로 링크를 걸어서 이동하려 할 경우 작동을 안한다.


구글링해보니 다른 사람들도 이같은 문제를 겪고 있어서

쉽게 해결 방법 찾음


stack overflow 에 (밑에 링크) 여러가지 방법이 있었지만

http://stackoverflow.com/questions/7062061/button-not-working-in-ie8

http://stackoverflow.com/questions/802839/button-inside-of-anchor-link-works-in-firefox-but-not-in-internet-explorer


나는 다음 방법으로 해결했다.


$("a > button").live('click', function() {
    location.href = $(this).closest("a").attr("href");
}); // fixed

동작은 아주 잘됨