0

I have written some javascript code to hide and element based on id inside php, but it is not working

<?php
    if(isset($_POST['sign_up_btn'])){
        echo '
        <script>

        $(document).ready(function() {
            $("#first").hide();
            $("#second").show();
            });

        </script>

        ';
    }
    ?>

I'm including jquery library like this in the tag above the closing body tag

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

I solved it by referencing my jquery library before the echo... Thanks David

0 Answers0