SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
-
Mar 28, 2009, 11:40 #1
select list navigation without js
I have some navigation like:
Code HTML4Strict:<select> <option>text</option> <option value="#">link text</option> <option value="#">link text</option> .... </select>
Right now js opens the URL in the value attribute, but I want users to be able to navigate if js is turned off. Is that possible using this markup?
-
Mar 28, 2009, 12:30 #2
- Join Date
- Dec 2007
- Posts
- 358
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Maybe you can replace them with <a ...>...</a> tags but then you will need a complex CSS solution to create select-like functionality. Anyway, it may be something like CSS-only menu: http://google.com/search?q=css+menu
-
Mar 28, 2009, 14:02 #3
That might be a good idea.. I'm pretty sure anchors cannot be used in option elements but I wasn't 100% sure..
-
Mar 29, 2009, 00:40 #4
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No, you cannot. An option element can only contain text (#PCDATA); no markup.
I think that what alex.w747 meant was that you could replace the entire select element with a list of links and style it to look similar to a select. You'd still need JavaScript, though, if you want it to work in IE6 and other ancient browsers that don't have full support for the :hover pseudo-class.Birnam wood is come to Dunsinane
Bookmarks