Skip to content

Add href attribute to all html tags and use to link pages like anchor tag

License

Notifications You must be signed in to change notification settings

Niyko/href-For-EveryThing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

href For EveryThing logo 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.

About

Add href attribute to all html tags and use to link pages like anchor tag

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published