I need help with this logout link i made

When you click it, it should show a confirm box, but it doesn't.

Heres the Javacript

<script language='javascript'>
function confirm(){
var f = confirm("Are You Sure You Want To Logout?");
return true;
return false;

And heres the link

<a href='logout.php' onClick='return confirm()'>logout</a>

Plz help??

Hi DealthRune,

you could try this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Free Live Help!</title>
<script type="text/javascript">
var _confirm = function() {

   if ( confirm("Are You Sure You Want To Logout?"))
// JavaScript-1.5 -->
<body id="body">
<div id="div">
<a href="#" onclick="_confirm();">Logout</a>

Oouoo thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.