 <p>In javascript, make an ajax function,</p> <pre><code>function myAjax() { $.ajax({ type: "POST", url: 'your_url/ajax.php', data:{action:'call_this'}, success:function(html) { alert(html); } }); } </code></pre> <p>Then call from html,</p> <pre><code>&lt;a href="" onclick="myAjax()" class="deletebtn"&gt;Delete&lt;/a&gt; </code></pre> <p>And in your ajax.php,</p> <pre><code>if($_POST['action'] == 'call_this') { // call removeday() here } </code></pre>