Toggle Attribute From DOM Element For jQuery | toggleAttr.js

toggleAttr has altered the attribute of the jQuery DOM element. toggleAttr.js is a very small jQuery extension that makes it possible to swap single or multiple attributes from a given DOM in a single JS call.

toggle attribute jquery, toggle attribute hidden, jquery toggle hidden attribute, jquery toggle data attribute, toggle javascript, jquery toggle attribute true false

Example usage:

  • $(“.example”).toggleAttr(‘attributeName’);
  • $(“.example”).toggleAttr(‘attributeName=”exampleValue”‘);
  • $(“.example”).toggleAttr(‘attributeName attr2=”value” attr3’);

How to make use of it:

1. Load the jQuery-toggleAttr.js JavaScript library after jQuery.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jQuery-toggleAttr.js"></script>

2. Remove the href attribute from a link.

<a href="" id="linkExample">
  Example Link
<!-- Result: -->
<a id="linkExample">
  Example Link

Toggle Attribute From Element, toggleAttr Plugin/Github, toggle attr jquery, toggle attribute in jquery, jquery toggle attribute value, toggle property jquery

See Demo And Download

Official Website(gokhanege): Click Here

This superior jQuery/javascript plugin is developed by gokhanege. For extra Advanced Usage, please go to the official website.

Related Posts


Bootstrap 4 Sidebar Menu Responsive Template | MDB

Bootstrap Side Navbar – Responsive sidebar template based on the Bootstrap 4 framework. An easy-to-use, totally responsive, Google Material Design impressed aspect navigation for modern web app…


Bootstrap 5 Treeview Dynamically Collapsible | bs5treeview

Bootstrap 5 Tree View is a very simple plug-in for creating a basic and elegant Treeview using BS5. For use with Bootstrap 5, the attributes have been…


Responsive FAQ Accordion Dropdown In HTML and CSS

How to create responsive accordion Expandable and Collapsible Frequently Asked Questions Elements. Accordion HTML, is an easy and seamless accordion FAQ component built with CSS and HTML…


Modern Mobile Touch Slider With Acceleration Transitions | Swiper

Swiper is the most modern free mobile touch slider with accelerated device transitions and amazing original behavior. It is intended for use in mobile websites, mobile web…


[Steps] A Simple, Lightweight jQuery Step Wizard Plugin

jQuery steps wizard is a simple and lightweight plugin. The step is a jQuery plugin that turns any grouped elements into a step-by-step wizard with navigation buttons…


Responsive Image Gallery Lightbox jQuery Plugin | VenoBox

VenoBox is a responsive jQuery modal window plugin suitable for images, embedded content, iFrames, Google Maps, Vimeo, and YouTube videos. The big difference compared to many other…

Leave a Reply

Your email address will not be published. Required fields are marked *