The example in this article describes the method of using JavaScript to redirect clicks on radio button links to the corresponding URL. Share it with everyone for your reference. The details are as follows:
A button special effect is implemented here. When the check box button is clicked, the link is activated and jumps to a certain URL. Here are mainly some functions derived from onClick. Then with the function, you can write more button special effects. Come.
The screenshot of the running effect is as follows:
The specific code is as follows:
<html> <head> <title>点击文本框激活链接转向某网址</title> <SCRIPT> function go(loc) { window.location.href = loc; } </script> </head> <body> <form name="form"> <div align="center"> <input type="radio" name="loc" onClick="go('http://www.baidu.com');"> 百度搜索<br> <input type="radio" name="loc" onClick="go('http://www.jb51.net');"> 脚本之家<br> <input type="radio" name="loc" onClick="go('http://www.qq.com');"> 腾讯QQ<br> </div> </form> </body> </html>
I hope this article will be helpful to everyone’s JavaScript programming design.