Click here to Skip to main content
15,892,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

lets say i have two html files in my project. lets call them 1.html and 2.html.

I have also got a combobox like so ..
HTML
<select>

         <option value="html1"> got to html 1 </option>
         <option value="html2"> go to html 2 </option>
</select>


I would like when either option 1 is selected to open up the 1.html file or when opition 2 is selected to go 2.html.

i have tried to this .. like below but its not working
HTML
<select>

         <option value="html1"  href="#/folder1/1"> > got to html 1 </option>

         <option value="html2"  href="#/folder1/2"> go to html 2 </option>
</select>
Posted
Updated 4-Sep-14 0:38am
v5

1 solution

See this example for dropdown


HTML
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
    <option value="">Choose a destination...</option>
    <option value="/1.html">YAHOO</option>
    <option value="/2.html">GOOGLE</option>
</select>


MY JS Fiddle example here

http://jsfiddle.net/y4yAP/466/[^]
 
Share this answer
 
v2
Comments
1Future 4-Sep-14 7:01am    
Works! Thank you soo much!!! i really do appreciate your help and for your time too. thank you
Gihan Liyanage 4-Sep-14 7:03am    
Welcome dude..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900