{"id":15007582,"url":"https://github.com/oguzhan18/html-attribute-manager","last_synced_at":"2025-10-30T12:31:36.124Z","repository":{"id":227847606,"uuid":"771188003","full_name":"oguzhan18/html-attribute-manager","owner":"oguzhan18","description":"Html Attribute Manager is a JavaScript class for managing HTML elements with specific attributes.","archived":false,"fork":false,"pushed_at":"2024-03-20T07:00:13.000Z","size":3818,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-07T07:11:49.154Z","etag":null,"topics":["attributes","html-attribute-manager","html-attributes","javascript","javascript-library","npm-package","npmjs","package"],"latest_commit_sha":null,"homepage":"https://html-attribute-manager.vercel.app/#/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oguzhan18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-12T21:06:00.000Z","updated_at":"2024-03-18T08:49:49.000Z","dependencies_parsed_at":"2024-03-15T13:09:21.238Z","dependency_job_id":null,"html_url":"https://github.com/oguzhan18/html-attribute-manager","commit_stats":null,"previous_names":["oguzhan18/html-attribute-manager"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Fhtml-attribute-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Fhtml-attribute-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Fhtml-attribute-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oguzhan18%2Fhtml-attribute-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oguzhan18","download_url":"https://codeload.github.com/oguzhan18/html-attribute-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230650619,"owners_count":18259291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attributes","html-attribute-manager","html-attributes","javascript","javascript-library","npm-package","npmjs","package"],"created_at":"2024-09-24T19:11:47.773Z","updated_at":"2025-10-30T12:31:34.718Z","avatar_url":"https://github.com/oguzhan18.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" # HTML Attribute Manager\n`HtmlAttributeManager` is a JavaScript class for managing HTML elements with specific attributes.\n\n## Installation\n````bash\nnpm install html-attribute-manager\n````\n\u003ca href=\"https://www.npmjs.com/package/html-attribute-manager\" tagret=\"_blanl\"\u003e Click for npmJS.com URL \u003c/a\u003e \u003cbr\u003e\n\u003ca href=\"https://html-attribute-manager.vercel.app/#/\" tagret=\"_blanl\"\u003eClick for Documentation URL\u003c/a\u003e\n\n## Usage\nFirst, import `HtmlAttributeManager` into your JavaScript file:\n\n`````bash\nconst HtmlAttributeManager = require('html-attribute-manager');\n`````\nThen, create an instance of HtmlAttributeManager by providing an object containing attribute-function pairs:\n\n````bash\nconst attributeManager = new HtmlAttributeManager({\n    \"toggle-visibility\": \"toggleVisibility\",\n    \"change-color\": \"changeColor\"\n});\n````\n## Constructor\nHtmlAttributeManager(attributeName, functionName)\nCreates an instance of HtmlAttributeManager.\n\n* attributeName (`string`): The name of the HTML attribute to search for.\n  \n* functionName (`string`): The name of the function to call for each matching element.\n\n## Methods\n`handleEvent()`\nFinds HTML elements with the specified attribute and calls the corresponding function.\n`destroy()`\nRemoves the event listener when the instance is no longer needed.\n## Example\n````javascript\n// Define functions\nwindow.toggleVisibility = function(element, value) {\n    if (value === 'true') {\n        element.style.display = 'block';\n    } else {\n        element.style.display = 'none';\n    }\n};\n\nwindow.changeColor = function(element, color) {\n    element.style.color = color;\n};\n\n// Create an instance of HtmlAttributeManager\nconst attributeManager = new HtmlAttributeManager({\n    \"toggle-visibility\": \"toggleVisibility\",\n    \"change-color\": \"changeColor\"\n});\n````\n## Contributing\nContributions are welcome! Please feel free to submit issues or pull requests on \u003ca href=\"https://github.com/oguzhan18/html-attribute-manager\" target=\"_blank\"\u003eGithub\u003c/a\u003e.\n\n## License\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhan18%2Fhtml-attribute-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foguzhan18%2Fhtml-attribute-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foguzhan18%2Fhtml-attribute-manager/lists"}