Jump to content

Need help with html include file & drop-down navbar


mjs9361

Recommended Posts

Hello, I'm revising an old website for a client and trying to use html includes per w3schools (https://www.w3schools.com/howto/howto_html_include.asp). In one of the include files I have the responsive dropdown menu code (https://www.w3schools.com/howto/howto_js_responsive_navbar_dropdown.asp). Everything was working great with the menu until I moved it into the include file; now in the mobile view, the menu doesn't appear on click. Can anyone tell me, does putting dropdown menu code not work in an include file? I can attach code if needed.

Mary Jo

Link to comment
Share on other sites

Javascript does not work in HTML includes, you have to load the Javascript sections including the onclick event from their own .js file using <script> tags.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...