运行 ❯
获取你
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <p>Select your favorite browser:</p> <form action="/action_page.php"> <input type="radio" name="browser" onclick="myFunction(this.value)" value="Internet Explorer">Internet Explorer<br> <input type="radio" name="browser" onclick="myFunction(this.value)" value="Firefox">Firefox<br> <input type="radio" name="browser" onclick="myFunction(this.value)" value="Opera">Opera<br> <input type="radio" name="browser" onclick="myFunction(this.value)" value="Google Chrome">Google Chrome<br> <input type="radio" name="browser" onclick="myFunction(this.value)" value="Safari">Safari<br><br> Your favorite browser is: <input type="text" id="result"> <input type="submit" value="Submit form"> </form> <script> function myFunction(browser) { document.getElementById("result").value = browser; } </script> </body> </html>