Only when clicking the Reply button should go to the example.com page

<html> <head> <title></title> </head> <body> <script language="JavaScript"> function F1() { if (document.getElementById("text").value == '4') alert('Молодец!'); else alert('Подумай еще!'); } </script> <b>2+2=</b> <input id="text" name="text" type="text" value=""> <input OnClick="F1();" name="button" type="button" value="Ответить"> </body> </html> 

    2 answers 2

    Press + if it helps

     <html> <head> <title></title> </head> <body> <script language="JavaScript"><!-- function F1() { if (document.getElementById("text").value == '4') { alert('Молодець!'); window.location.href = "http://www.154.org.ua/7-b"; } else { alert('Подумай ще!'); } } // --></script> <b>2+2=</b> <input type="text" name="text" id="text" value=""> <input type="button" name="button" value="Ответить" OnClick="F1();"> </body> </html> 
    • Yes, damn the same thing, but in general the code is completely ready, can you contact the TS and write everything for it? :) - Zowie
    • You do not tell me how the sign \ / differs from this \\? - Karlos Derga
    • depending on what the code is! if // then this is a comment if in this case it masks the quotation mark "\" "well, maybe still so var a = / [0-9] [AZ] ig / then this regular expression is Eugene536
    • Look, I make a website and I have a page in the mathematics folder, and the photos in the pages and images folder which html code should I put? When the page is in the pages and images folder, then the pictures are visible, and when in the Mathematics folder, it’s just a small square with a leaflet (which is the link, and a file in another folder) I can’t push the picture into the maths folder. Help please - Karlos Derga
    • If we want to display a photo from the "pages and images" folder in the "mathematics" folder and these folders are on the same level then in this case // it indicates the transition to the main directory <img href = "/ pages and images / 1.jpg" > or so <img href = "../ pages and images / 1.jpg"> - Eugene536

    Use the location property:

     function F1() { if (document.getElementById("text").value == '4') { alert('Молодець!'); window.location.href = "http://www.154.org.ua/7-b"; } else { alert('Подумай ще!'); } } 
    • Can be fully - Karlos Derga
    • So I copied with the code of your function and added the location by condition there is an alert guy) or what do you want?) - Barton
    • Totally starting from <html> and ending </ html> - Karlos Derga
    • PPC .. you can not compare 2 functions and find that there is only one line added ???? Instead, some kind .. copied my code and you accepted his answer. I'm in shock - Barton
    • He really tupit =) - Eugene536