rom fernando rom fernando - 2 months ago 6
HTML Question

How can I block a repeat action in a button click?

I create a website intro page in HTML. I click a button to redirect the website home page. Now I click two or more times, meaning that the website opens twice or more. I want a home page only. How can I block that button when a home page is open?

Answer

If you have a button in a form,

<a href="JavaScript:;" id='submit' >
 <img src= "images/remote_support.png"  width="140px" height="60px" style="position: absolute; top: 450px; left: 1000px;" />
</a>????????????????????????????????????????

With JavaScript/jQuery just submit form and make

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
    $(document).ready(function(){
        $('#submit').click(function(){
            newPopup('livesupport:8080/…');
            $('#submit').hide();
        });
    });
</script>