1.0.0 • Published 6 months ago

get-year v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Get Year

Insert current year into any HTML element by CDN script


Features

  • Works instantly via CDN tag
  • Config through data-get-year attribute
  • Supports default .current-year class

Usage

<span class="current-year"></span>
<script src="https://cdn.jsdelivr.net/npm/get-year"></script>

Extended Configuration

<div data-get-year=".footer-year"></div>

Parameters:

data-get-year="[selector]"

  • Optional parameter: CSS selector to target other elements
  • If empty, updates the element itself

Example Implementation

<!DOCTYPE html>
<html>
<head>
    <title>Get Year Example</title>
    <script src="https://cdn.jsdelivr.net/npm/get-year"></script>
</head>
<body>
    <!-- Basic usage -->
    Copyright © <span class="current-year"></span>
</body>
</html>

License

MIT License


Contributing

Contributions welcome! Feel free to:

  • Fork the repository
  • Submit pull requests
  • File issues
  • Suggest improvements
1.0.0

6 months ago