• Hi,
    I am trying to access my footer using javascript in a .php file.
    but the footer var is always null.
    any help?

    <script type="text/javascript">
      var _document = jQuery(document);
      var footer = document.getElementById("colophon");
      console.log("footer: " + footer);
    
      //footer.style.marginRight = 100 + 'px';
    
    </script>
Viewing 1 replies (of 1 total)
  • Site link where you are trying to do this might help, as probably you are providing a wrong div id.

    And if you are using jQuery, you can do that like this instead:

    <script type="text/javascript">
     $footer = jQuery('#colophon');
     console.log("footer: " + $footer);
     $footer.css('margin-right', '100px');
     //footer.style.marginRight = 100 + 'px';
    </script>

Viewing 1 replies (of 1 total)
  • The topic ‘access my footer using javascript in a .php file’ is closed to new replies.