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
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>
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>
href For EveryThing
example is available in codepen
, Check it out : https://codepen.io/niyko/pen/XWmYvPN
Href For EveryThing is licensed under the MIT License.