Question

This is my Code:

<div onclick="window.location = photo.php"></div>

But the url if I click on the div is:

http://www.domain.com/[object%20HTMLDivElement]

What could be the reason for it?

Was it helpful?

Solution

The url needs to be a string:

<div onclick="window.location = 'photo.php'"></div>

OTHER TIPS

missing quotes in the value.

<div onclick="window.location = 'photo.php'"></div>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top