Bizmind Posted October 30, 2008 Share Posted October 30, 2008 Hi,I am really2 new to HTML. I already read the tutorials about HTML. (almost done)I read about the drop down menu in the "form" section.I am thinking how to build drop down lists that each of the list have link to other site. Visitor just click on either one ofthe list and they will be brought to a new site. Please guide me where can I find the solution or maybe thereis someone who is kind enough to show this simple codings.=))Thanks in advance.Regards,Tim Link to comment Share on other sites More sharing options...
Peppe L-G Posted October 30, 2008 Share Posted October 30, 2008 You need Javascript to do a thing like that, and if you've just started to learn HTML you probably don't know Javascript yet.But it's not advanced Javascript, or very much code, so here's an example: <select onchange="window.location = this.value;"> <option>Choose a website!</option> <option value="http://www.w3schools.com">W3 School</option></select> Or did you have something else in your mind? Link to comment Share on other sites More sharing options...
SillyBilly Posted October 31, 2008 Share Posted October 31, 2008 You need Javascript to do a thing like that, and if you've just started to learn HTML you probably don't know Javascript yet.But it's not advanced Javascript, or very much code, so here's an example:<select onchange="window.location = this.value;"> <option>Choose a website!</option> <option value="http://www.w3schools.com">W3 School</option></select> Or did you have something else in your mind? You can have a drop down menu list using HTML and CSS only. This example has only the first item with a drop down menu, but you could easily repeat the code for the other items.The link is Listamatic Link to comment Share on other sites More sharing options...
Bizmind Posted October 31, 2008 Author Share Posted October 31, 2008 You need Javascript to do a thing like that, and if you've just started to learn HTML you probably don't know Javascript yet.But it's not advanced Javascript, or very much code, so here's an example:<select onchange="window.location = this.value;"> <option>Choose a website!</option> <option value="http://www.w3schools.com">W3 School</option></select> Or did you have something else in your mind? I tried to copy and paste the code to my html pad and browse it.When I click the w3school, there's nothing happen.One more thing is, where is the java script on the codes? Sorry I didn't see it.. Link to comment Share on other sites More sharing options...
Bizmind Posted October 31, 2008 Author Share Posted October 31, 2008 You can have a drop down menu list using HTML and CSS only. This example has only the first item with a drop down menu, but you could easily repeat the code for the other items.The link is Listamatic WOW!!This usage of css is not simple one..I spent 2 hours searching about the coding style in css butI can't found it.. For example this css class:#navlist a:link, #navlist a:visited{color: #fff;background-color: #036;text-decoration: none;}Why it put space between the #navlist and a:link? Why is it different with putting coma between them?ul#navlistwhy the ul and #navlist is near?? Why no space or coma?Sometime they also use * and >I really like to know the answer.. Link to comment Share on other sites More sharing options...
jlhaslip Posted October 31, 2008 Share Posted October 31, 2008 You need a lesson on Selectors Link to comment Share on other sites More sharing options...
Peppe L-G Posted October 31, 2008 Share Posted October 31, 2008 When I click the w3school, there's nothing happen.It works for me :/One more thing is, where is the java script on the codes?The Javascript is the value of the onchange attribute in the <select>. Or, I'm not sure, maybe it's not Javascript, it could be HTML DOM or DHTML, I've never learned the difference between them Link to comment Share on other sites More sharing options...
inktherapy Posted November 15, 2008 Share Posted November 15, 2008 Hi,onchange is, I believe is an attribute DOM. Link to comment Share on other sites More sharing options...
Synook Posted November 15, 2008 Share Posted November 15, 2008 onchange is an event!http://en.wikipedia.org/wiki/Document_Object_Model Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.