{"id":20058630,"url":"https://github.com/tlewin/jquery.placeholder","last_synced_at":"2026-06-13T07:31:54.365Z","repository":{"id":3978827,"uuid":"5074303","full_name":"tlewin/jquery.placeholder","owner":"tlewin","description":"Creates a CSS customizable placeholder for input elements for browsers that doesn't implement it. ","archived":false,"fork":false,"pushed_at":"2013-02-11T11:39:16.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T09:45:23.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"bl4de/security-tools","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlewin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-16T22:18:33.000Z","updated_at":"2014-05-04T15:45:14.000Z","dependencies_parsed_at":"2022-08-31T11:41:03.232Z","dependency_job_id":null,"html_url":"https://github.com/tlewin/jquery.placeholder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tlewin/jquery.placeholder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fjquery.placeholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fjquery.placeholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fjquery.placeholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fjquery.placeholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlewin","download_url":"https://codeload.github.com/tlewin/jquery.placeholder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlewin%2Fjquery.placeholder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34276501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T13:02:31.090Z","updated_at":"2026-06-13T07:31:54.339Z","avatar_url":"https://github.com/tlewin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery Placeholder - Plugin\n===========================\n\nCreates a CSS customizable placeholder for input elements for browsers that doesn't implement it.\n\n## Approach\n\nThe technique behind the plugin consists of create a label element pointing to the source input element (\"for\" attribute) and listening the for any change event. Once any character populates the source the label element is hidden. If the content of input element is erased the label element is set to visible again.\nThis approach focus on accessibility, since many tools uses the label content in order to \"read\" the screen content.\nMany other techniques can be used, but they have, in my opinion, serious drawback. For example:\n\n###Insert text into input element and remove it once the user punch any key:\n* Hard to customize, in most cases keeps the same input element customization.\n* It can send some erroneous content to the server.\n* Not recommended for accessibility tools.\n\n## Customization\nThe label element created by plugin has the class jq-ph that can be customized by CSS.\n\n## Parameters\n\n* **checkNative**: Check if browser has native support for placeholder. Actually, it doesn't check for CSS support (It will be included on next realease). _false_ by default.\n* **phText**: Placeholder text. If empty/ null/ undefined the plugin will search for _data-ph_ attribute. _null_ by default.\n* **className**: The element class name for CSS customization. The default class name is _jq-ph_.\n* **attrData**: Element attribute where placeholder text is stored. The default value is _data-ph_.\n\n## Examples:\n\n    // Create placeholder for any input element with data-ph attribute.\n    $().placeholder() // Same as $('[data-ph]').placeholder()\n  \n    // Insert a custom placeholder text into a specific element.\n    $('#my-input').placeholder({phText: 'Some text'}) \n\nLicenses:\n=========\n\njQuery Placeholder - Plugin is released under [GPL](https://github.com/tlewin/jquery.placeholder/raw/v0.1.0/GPL-LICENSE.txt) and [MIT](https://github.com/tlewin/jquery.placeholder/raw/v0.1.0/MIT-LICENSE.txt) licenses, same as jQuery software.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlewin%2Fjquery.placeholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlewin%2Fjquery.placeholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlewin%2Fjquery.placeholder/lists"}