I am a newbie in html. My scenarios goes as below. I have a drop down with values. My need is to navigate to respective webpage(which I have created for each values in the dropdown) on click/selection of one value. Help me in achieving this.
Asked
Active
Viewed 24 times
-3
-
Unfortunately, stack overflow is not a code generator, but you can use – Brank Victoria Jul 24 '18 at 08:06
-
My need is to achieve this using HTML only. – Ankur Sharma Jul 24 '18 at 08:07
-
Possible duplicate of [Using Javascript to change URL based on option selected in dropdown](https://stackoverflow.com/questions/835998/using-javascript-to-change-url-based-on-option-selected-in-dropdown) – Vucko Jul 24 '18 at 08:10
-
1Possible duplicate of [using href links inside – Brank Victoria Jul 24 '18 at 08:10
1 Answers
1
I think Javascript is needed for your case...
<select onchange="document.location.href=this.value;">
<option value="https://www.stackoverflow.com">Stack Overflow</option>
<option value="https://www.google.com">Google</option>
<option value="https://www.instagram.com">Instagram</option>
</select>

Chaska
- 3,165
- 1
- 11
- 17
-
Yes using java script it cane be done. Is there a way we can achieve this using only HTML? – Ankur Sharma Jul 24 '18 at 08:12