Rattribute.js allows you to define different HTML attributes for different viewport widths using simple data-* attributes. Whether you need to change classes, targets, ARIA attributes, or any other HTML attribute, Rattribute.js updates your elements automatically as the browser size changes β without writing responsive JavaScript.
This is a brand new project that I started a few days ago!
williamtroup
/
Rattribute.js
β A lightweight JavaScript library for automatically changing HTML element attributes based on responsive screen sizes.
β Rattribute.js allows you to define different HTML attributes for different viewport widths using simple data-* attributes. Whether you need to change classes, targets, ARIA attributes, or any other HTML attribute, Rattribute.js updates your elements automatically as the browser size changes β without writing responsive JavaScript.
v1.3.1
What features does Rattribute.js have?
- π Zero dependencies and lightweight.
- π Written in TypeScript with excellent editor support.
- π± Responsive breakpoints matching Bootstrap (
xsβxxl), plus custom sizes. - π Automatically detects new DOM elements.
- βοΈ Public API for manual control.
- π― Ignore specific elements when needed.
- π§© Set attribute values directly or from function calls.
What browsers are supported?
Rattribute.js works in all modern browsers, including:
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
- Safari
- Opera
What are the most recent changes?
To see a list of all the most recent changes, click here.
How do I install Rattribute.js?
Youβ¦
United States
NORTH AMERICA
Related News

Mattress Firm Coupons: Save up to $600
4h ago
π I Built a Dropshipping Automation Pipeline β Here's What I Learned (and What I'd Do Differently)
11h ago
How I Cut My LLM API Bill by 40x: A Freelancer's Migration Story
11h ago
Cursor AI Review 2026: The AI-Native Code Editor
8h ago

Another Model Rewrote My Memories. Here's How I Caught It.
8h ago