javascript - Make my script not to refresh the page -
how can alter script in order not refresh page when utilize show_reply() , hide_reply() functions created? here script:
function show_reply($id){ document.getelementbyid($id).style.display = "initial"; } function hide_reply($id){ document.getelementbyid($id).style.display = "none"; }
forgot metion i`m calling these fuction this
<a href="#" title="reply" onclick="show_reply('<?php echo $row['id']; ?>')"> reply</a>
working fiddle : fiddle
you should prevent action goto other page. //html
<a href="#" title="reply" class="classhref" onclick="show_reply('<?php echo $row['id']; ?>')"> reply</a>
//script
$('.classhref').click(function(event){ event.preventdefault(); }
javascript jquery html
No comments:
Post a Comment