An open API service indexing awesome lists of open source software.

https://github.com/milesbarr/enhancejs

A lightweight JavaScript library that provides progressive enhancements for HTML.
https://github.com/milesbarr/enhancejs

html html5 javascript javascript-vanilla js progressive-enhancement vanilla-javascript vanilla-js

Last synced: 9 months ago
JSON representation

A lightweight JavaScript library that provides progressive enhancements for HTML.

Awesome Lists containing this project

README

          

# Enhance.js

A lightweight JavaScript library that provides progressive enhancements for HTML
forms and user interactions. This library adds functionality while maintaining
zero dependencies and graceful degradation.

## Setup

Include the library in your HTML file:

```html

```

For graceful degradation for users with JavaScript disabled, copy
[`noscript.html`](noscript.html) into the `` section of your HTML file.

## Usage

### Form Confirmations

Add confirmation dialogs to forms or form submission buttons:

```html


Submit

```

### Unsaved Changes Warning

Warn users about unsaved changes in forms:

```html

```

### Share Buttons

Add share functionality:

```html
Share
```

### Copy Buttons

Add copy-to-clipboard functionality:

```html

Copy
```

### Image File Previews

Preview images for file inputs:

```html


```

### Character Counter

Display the remaining character count for text inputs:

```html


```

### Auto-Resizable Textareas

Automatically adjust textarea height based on content:

```html

```

### Smooth Scrolling

Automatic smooth scrolling to anchor links:

```html
Go to section

Content

```

### Invalid Inputs

Automatically reset `aria-invalid` attributes:

```html

```

### File Drag-and-Drop

Add file drag-and-drop functionality:

```html

```

### AJAX Support

Use AJAX for form submissions and link navigation:

```html


Refresh page

```

## Graceful Degradation

All features are implemented as progressive enhancements, meaning the basic
functionality will work even if JavaScript is disabled.

## License

This project is licensed under the [MIT License](LICENSE).