HTML – how to make an entire DIV a hyperlink? [duplicate]

You can add the onclick for JavaScript into the div.

<div onclick="location.href="https://stackoverflow.com/questions/2188272/newurl.html";">&nbsp;</div>

EDIT: for new window

<div onclick="window.open("https://stackoverflow.com/questions/2188272/newurl.html",'mywindow');" style="cursor: pointer;">&nbsp;</div>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)