Search code examples
phpif-statementhref

How to make a div to span below when a href was clicked?


I want to make an if statement where a will span after user clicks a href. The problem is that I don't know how to make the if statement looks like. This is the href

echo"<td><a href='catchhistory.php?id=$iddoc'> View Result </a></td>";

Solution

  • I guess it easier to make it on jQuery javascript

     $(function () { 
        var my_div = $('#myDiv');
        $('#myButton').on('click', function() {
         $(this).after(my_div).show();
    
        }
    }
    

    add ID to your

    <div id='myDiv' style='display:none'>tqweqwe</div>

    add ID to your href

    <a id='myButton' href="#">qeqwe</a>