[ 이 글은 2016년 8월 2일에 최종 수정되었습니다. ]

참고: 인기 워드프레스 테마 중 하나인 The 7이 39달러로 할인 중입니다.

How can it be possible to make a whole ‘div’ clickable?

<div class="clickable" url="http://google.com">
Text
</div>

In this case, you can use the following jQuery script to redirect users to the url specified when clicking the ‘div’ area: 

$("div.clickable").click(
function()
{
window.location = $(this).attr("url");
return false;
});
// Source: http://stackoverflow.com

Here, return false is used to avoid an event bubbling. Some recommend to use event.preventDefault() rather than return false. Please refer to  here for more about event.preventDefault() and return false.

If you want to specify the url directly within the jQuery script, please use the following:

jQuery('.clickable).click(function(){
window.location = 'http://www.google.com';
});

Please feel free to leave a Comment (). Have a great day.