博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何给按钮加上链接跳转功能
阅读量:7102 次
发布时间:2019-06-28

本文共 734 字,大约阅读时间需要 2 分钟。

hot3.png

1.在原窗口打开链接 
    <input type="button"  value="闪吧" onClick="location='http://www.flash8.net'"> 
    <button onClick="location.href='http://www.flash8.net'">闪吧</button> 
    <form action="http://www.flash8.net"><input type="submit" value="打开链接"></form> 
    2.在新窗口中打开链接 
    <input type="button"  value="闪吧" onClick="window.open('http://www.flash8.net')"> 
    <button onClick="window.open('http://www.flash8.net')">闪吧</button> 

    <form action="http://www.flash8.net" target="_blank"><input type="submit" value="打开链接"></form> 

 
如: 
 
<button onClick="this.innerHTML='<font color=\'red\'>http://www.flash8.net</font>'">闪吧</button> 
 
或 
 
<button onClick='this.innerHTML="<font color=\"red\">http://www.flash8.net</font>"'>闪吧</button> 

转载于:https://my.oschina.net/rouchongzi/blog/111883

你可能感兴趣的文章
ruby 可枚举模块Enumerable
查看>>
线阵CCD和面阵CCD
查看>>
[BZOJ 3211]花神游历各国(并查集+树状数组)
查看>>
Python中给文件加锁
查看>>
4.9Python数据类型(5)列表(新版)
查看>>
软件构造期末复习考点总结
查看>>
7 Django的模板层
查看>>
EF中Json序列化对象时检测到循环引用的解决办法
查看>>
词向量概况
查看>>
css3 画圆记录
查看>>
javascript中级
查看>>
《CLR Via C# 第3版》笔记之(十五) - 接口
查看>>
golang实现ios推送
查看>>
【Linux】linux常用基本命令
查看>>
libsvm使用说明
查看>>
CodeForces 595A Vitaly and Night
查看>>
秒杀读后感2
查看>>
插入排序
查看>>
Session机制详解
查看>>
【转】使用PHP导入和导出CSV文件
查看>>