chaser7016
chaser7016

Reputation: 595

JS Function to create link - how?

I have the following code in my html

<input type="image" src=images/more.png   onClick="showInviteInfo() />

When clicked it brings up a pop up box via this js function.

function showInviteInfo(){
        document.getElementById("divsignup").style.visibility = "visible";
            document.getElementById("txtemail").focus();

}

But I no longer want it to bring up pop up rather when clicked take user to a new page. What do I need to change? Probably easy, but I am a newbie.

Upvotes: 0

Views: 93

Answers (2)

Luke Schafer
Luke Schafer

Reputation: 9265

change

<input type="image" src=images/more.png   onClick="showInviteInfo() />

to

<a href="YOURLINK"><img src="images/more.png" /></a>

EDIT: sorry, the editor was giving me grief with the second line

Upvotes: 1

rahul
rahul

Reputation: 187110

Use

window.location = "new location path";

in your function.

window.location

If you can use an anchor tag then it would be like this.

<a href="new location" id="anchLoc">Click here to navigate to new page</a>

Upvotes: 1

Related Questions