Inserting a form and select dropdown via Javascript
This is an open discussion with 1 reply, filed under XSLT.
Search
I've since realised that I can simply hide what I need to using CSS as Modernizr gives me 'js' and 'no-js' classes to play with, so this isn't a must-solve for me any more as I can cover both JavaScript and non-JavaScript users.
However, this does potentially leave those with JavaScript and CSS disabled with a useless, visible select menu, so I'd still be interested in any insights.
Create an account or sign in to comment.
I'd like to have a form containing one select menu (to be used as a nav menu) to be inserted into the HTML via Javascript. However, this menu relies on the XML data and some XSLT.
How can I have the form inserted into HTML only if JavaScript is available?
Context: this form containing a select menu is intended to "replace" an unordered list for mobile browsers. Via media queries, I'm hiding either the form or the ul depending on viewport width. I only want it in the HTML if JavaScript is available because JavaScript is required to make it function and result in a new page load.
Thanks.