Href For EveryThing - Add href attribute to all html tags and use to link pages like anchor tag

栏目: IT技术 · 发布时间: 5年前

内容简介:Now you can add

Href For EveryThing - Add href attribute to all html tags and use to link pages like anchor tag Href For EveryThing is a small script that can be used to add href attribute to all html tags and use to link pages like anchor tag. HREF attribute will work as a normal anchor tag, The cursor is set to pointer automatically. href For EveryThing also supports dynamic html, href For EveryThing will automatically detect dynamic tag or content insertions and work as normal. No more wraping everything in anchor tag to use link. Demo is vailable in codepen, Check it out, https://codepen.io/niyko/pen/XWmYvPN

Get started

1) Add the CDN scripts

href For EveryThing needs jquery to work, So add the CDN of jquery if not already added. Then add the href For EveryThing.js CDN into your project.

<!-- JQUERY -->
  <script src='https://code.jquery.com/jquery-3.5.1.js'></script>

  <!-- HREF FOR EVERYTHING -->
  <script src='https://cdn.jsdelivr.net/gh/Niyko/href-For-EveryThing/src/hrefForEveryThing.js'></script>

2) Add href to any html element

Now you can add href attribute to any HTML element as you want. When that element is clicked, the given link, Like :

<button href="http://google.com">Click me</button>

  <div href="http://google.com">Click me</div>

  <h1 href="http://google.com">Click me</h1>

Example

href For EveryThing example is available in codepen , Check it out : https://codepen.io/niyko/pen/XWmYvPN

License

Href For EveryThing is licensed under the MIT License .


以上所述就是小编给大家介绍的《Href For EveryThing - Add href attribute to all html tags and use to link pages like anchor tag》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

爆发

爆发

[美] 艾伯特-拉斯洛·巴拉巴西 / 马慧 / 中国人民大学出版社 / 2012-6 / 59.90元

1. 本书是一本超越《黑天鹅》的惊世之作。如果说塔勒布认为人类行为是随机的,都是小概率事件,是不可以预测的;那么全球复杂网络权威Barabasi则认为,人类行为93%是可以预测的。 2. Barabasi的研究是在人类生活数字化的大数据时代基础上进行的,移动电话、网络以及电子邮件使人类 行为变得更加容易量化,将我们的社会变成了一个巨大的数据库。他认为,人类正处在一个聚合点上,在这里数据、科学......一起来看看 《爆发》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具