windows.location avec target=blank

Par jim88, il y a 4 ans


Bonjour,

J'aimerai ajouter une cible blank à un windows.location et je n'arrive pas à trouver la syntaxe.
Est-ce qu'un expert pourrait m'aider ?
Voilà mon code :

<form name="f1"><select name="s1"> <option selected="selected" value="link1.html">Austria <option value="link2.html">Spain <option value="link3.html">Sweden </select> <input name="go" type="button" value="Go!" onClick="window.location=document.f1.s1.options[document.f1.s1.selectedIndex].value"/></form>

Merci ! :)

3 réponses

popotte, il y a 4 ans

Salut, pour target blank faut utiliser window/open :p

window.open(document.f1.s1.options[document.f1.s1.selectedIndex].value, '_blank');
jim88, il y a 4 ans

Merci popotte, ca marche à la perfection !

popotte, il y a 4 ans

de rien ;)