Link to home
Start Free TrialLog in
Avatar of Sumukha
Sumukha

asked on

How to open onClick='window.location'"http://www.trallalla.com" in a new window?

Hello Experts,

How can I modify

<div Width="130px" class='CategoryBox' style="CURSOR: pointer" onClick='window.location="http://www.trallalla.com" ' onmouseover='this.className="OverCategoryBox";' onmouseout='this.className="CategoryBox";'>Trallalla</div>

so it opens in a new window?

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try this
<div Width="130px" class='CategoryBox' style="CURSOR: pointer" onClick='window.open="http://www.trallalla.com" ' onmouseover='this.className="OverCategoryBox";' onmouseout='this.className="CategoryBox";'>Trallalla</div>
Avatar of Sumukha
Sumukha

ASKER

This worked perfectly. Thanks!
what is wrong with my answer

>>what is wrong with my answer
window.open is a method, not a property. You just overwrote the function reference with a string. It will not open a window.
Avatar of Sumukha

ASKER

Hello erikTsomik,

your suggestion did not work.

Thanks for suggesting anyway.