This is a discussion on "XHTML strict, name vs. id" within the JavaScript Forum section. This forum, and the thread "XHTML strict, name vs. id are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
XHTML strict, name vs. id
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
XHTML strict, name vs. id
I have a jump navigation box that works great
I've tried using only id="menu" with the following code, but it didn't work:
Last edited by masonbarge; Feb 27th, 2008 at 15:34. Reason: eliminate scrollbars |
|
|
|
|||
|
Re: XHTML strict, name vs. id
That's some pretty weird javascript you have there! You need to use a different way to reference your HTML elements.
The simplest way is to give everything an ID. For example, <select id="list">. Then use document.getElementById to refer to it. For example, onchange="if (document.getElementById("list").selectedIndex != 0) Not sure about that last bit (selectedIndex). |
|
||||
|
Re: XHTML strict, name vs. id
Thanks for the response.
I found a really elegant, long-term solution at http://abeautifulsite.net/notebook.php?article=28 Basically, you create a function that turns any "select" tag, which has an id tag, into a javascript jump link. Then you just put it in an external file. This is nice, since you still have "name" attribute available for "select" tags in XHTML 1.0 Strict. And if you need the id tag in a select for something else, even a bare-amateur like myself can change the javascript. Here's the function:
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strict XHTML - Displaying RSS feeds | grandadbob | Web Page Design | 2 | Mar 7th, 2008 09:10 |
| Strict Vs Transitional - Problems in Firefox !! | slimboyfatz32 | Web Page Design | 11 | Feb 19th, 2008 09:46 |
| Problem validating "Strict" with forms | Craigj1303 | Web Page Design | 2 | Jan 22nd, 2008 15:01 |
| Strict XHTML validation error : "tabindex" | newoptical | Web Page Design | 1 | Aug 24th, 2007 16:21 |
| Form fails strict XHTML validation | newoptical | Web Page Design | 10 | Jun 7th, 2007 12:08 |