JavaScript confirm box not working in php
<pre><code>echo"&lt;td&gt; &lt;a href ='del.php?id=$id' onclick='return confirm('Are you sure?');'&gt;&lt;center&gt;Delete&lt;/center&gt;&lt;/a&gt;&lt;/td&gt;";
</code></pre>

<p>i want a prompt msg as the user will click on "delete" if he/she will press "ok" then it will redirect to a page where the data will get deleted and if he/she will press "cancel" then nothing will happen.
by using the above code i m not able to get my prompt box nd data is directly getting deleted.</p>
