How to redirect to another .html file if a condition is triggered? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

How to redirect to another .html file if a condition is triggered?

For example if x == 10 The current html file will move to another one

13th Jun 2017, 11:17 PM
Complex
Complex - avatar
2 Respostas
+ 5
if (x==10) { document.location.href = 'new_document_url'; } ... or also window.location.href ^^
14th Jun 2017, 12:37 AM
visph
visph - avatar
+ 2
Awesome, thanks :D
14th Jun 2017, 12:40 AM
Complex
Complex - avatar