gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
<!DOCTYPE html> <html> <head> <title>Мой сайт</title> <style> select { margin-bottom:…
- User
button { display: block; margin-bottom: 10px; } </style><select id="selector"> <option value="">Выберите сайт</option> <option value="https://yandex.ru">Яндекс</option> <option value="https://google.ru">Гугле</option> <option value="https://energypk.ru/">Энергия</option> </select> <button><a id="link" href="">Перейти</a></button> <script> document.getElementById("link").addEventListener("click", function(event) { event.preventDefault(); var selector = document.getElementById("selector"); var selectedSite = selector.value; if (selectedSite !== "") { window.open(selectedSite, '_blank'); } }); </script> - Assistant
button { display: block; margin-bottom: 10px; } </style><select id="selector" onchange="redirectToSite()"> <option value="">Выберите сайт</option> <option value="https://yandex.ru">Яндекс</option> <option value="https://google.ru">Гугле</option> <option value="https://energypk.ru/">Энергия</option> </select> <button><a id="link" href="" onclick="redirectToSite()">Перейти</a></button> <script> function redirectToSite() { var selector = document.getElementById("selector"); var selectedSite = selector.value; if (selectedSite !== "") { window.open(selectedSite, '_blank'); } } </script>