{"id":20842802,"url":"https://github.com/mudge/jquery_example","last_synced_at":"2025-08-08T06:15:31.363Z","repository":{"id":389933,"uuid":"7514","full_name":"mudge/jquery_example","owner":"mudge","description":"jQuery plugin to populate form inputs with example text that disappears on focus. See also http://github.com/mudge/jquery_placeholder","archived":false,"fork":false,"pushed_at":"2017-07-17T07:36:32.000Z","size":205,"stargazers_count":107,"open_issues_count":1,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-30T09:47:30.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://mudge.name/jquery_example/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mudge.png","metadata":{"files":{"readme":"README.markdown","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}},"created_at":"2008-04-07T12:39:36.000Z","updated_at":"2023-09-26T15:11:42.000Z","dependencies_parsed_at":"2022-07-17T00:16:06.147Z","dependency_job_id":null,"html_url":"https://github.com/mudge/jquery_example","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/mudge/jquery_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Fjquery_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Fjquery_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Fjquery_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Fjquery_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudge","download_url":"https://codeload.github.com/mudge/jquery_example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudge%2Fjquery_example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269373398,"owners_count":24406376,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"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-18T01:25:32.118Z","updated_at":"2025-08-08T06:15:31.328Z","avatar_url":"https://github.com/mudge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery Form Example Plugin 1.6.2 [![Build Status](https://secure.travis-ci.org/mudge/jquery_example.png?branch=master)](http://travis-ci.org/mudge/jquery_example)\n======================================\n\nThis is a jQuery plugin to populate form inputs with example text that\ndisappears on focus.\n\nBasic usage revolves around the use of the `example` function like so:\n\n    $('input#name').example('Bob Smith');\n\nThis will then put the example text \"Bob Smith\" into the input with the ID\n\"name\". When a user then focuses on this input, the example text will\ndisappear, allowing them to enter their data. If they then click elsewhere\n*without entering any information*, the example will re-appear.\n\nBy default, example text is given the class `example`, allowing you to style\nit with CSS like so:\n\n    .example { color: #666; }\n\nIf this class name conflicts with one you already use, you can override it\nwith the `className` option like so:\n\n    $('input#name').example('Bob Smith', { className: 'hint' });\n\nThe above example would then be given the class `hint` instead of `example`.\n\nIf you plan to use the same options repeatedly, it is possible to override the\nplugin's defaults directly:\n\n    $.fn.example.defaults.className = 'notExample';\n\nThis will cause any uses of the plugin after this point to use the new\ndefaults.\n\nAs well as supplying the example text via a string, a callback function can be\nused instead to determine the value at runtime:\n\n    $('input#name').example(function() {\n       return $(this).attr('title'); \n    });\n\nThe above example will set the example text to the `title` attribute of the\ninput. The callback is executed within the context of the input field so, as\nin the example above, `$(this)` will return the input itself.\n\nIt is worth noting that the callback is evaluated every time the example text\nneeds to be inserted and *is not cached*. This makes it possible to\ndynamically change the example text of a field after page load like so:\n\n    $('input#name').example(function() {\n        var text = $(this).attr('title');\n        $(this).attr('title', 'Not the original title anymore');\n        return text;\n    });\n\nThe plugin also supports the jQuery Metadata plugin which allows you to \nspecify metadata in elements themselves. You can specify the example text and any options like so:\n\n    \u003cinput id=\"m1\" class=\"{example: 'An example', className: 'abc' }\" /\u003e\n\nPlease note that metadata will be overridden by arguments, e.g.\n\n    \u003cinput id=\"m1\" class=\"{example: 'An example'}\" /\u003e\n    $('#m1').example('Another example');\n\nThe example will be set to \"Another example\" instead of \"An example\".\n\nAll events are namespaced with `.example` so they can be selectively unbound with\n`unbind('.example')`. The full list is as follows:\n\n* `unload.example` on the `window`;\n* `submit.example` on any affected `form`s;\n* `focus.example` on affected inputs;\n* `change.example` on affected inputs;\n* `blur.example` on affected inputs.\n\nAs of 1.6.0, if you wish to manually trigger clearing examples from a form (e.g. because you wish to override a form's `submit` event in some way) then you can trigger a special custom event, `example:resetForm` to do so:\n\n```javascript\n$('#myform').trigger('example:resetForm');\n```\n\nNote that, due to event bubbling, triggering `example:resetForm` on a specific field will actual propagate up to its parent form and reset all examples.\n\n```javascript\n/* This will actually bubble up to trigger on #myform. */\n$('#myform input.name').trigger('example:resetForm');\n```\n\nDownloading\n-----------\n\n[Download jQuery Example 1.6.2](https://github.com/mudge/jquery_example/zipball/v1.6.2).\n\nOr use [Bower](http://bower.io/):\n\n```console\n$ bower install jquery_example\n```\n\nTesting\n-------\n\nAs of 1.4, this plugin now comes with a QUnit test suite that you can find\nin the test/ directory and run by opening index.html in your browser.\n\nCompatibility\n-------------\n\nThis plugin has been tested with jQuery 1.6 to 1.7.0 and should work in all\nbrowsers supported by jQuery itself (it has been tested with Safari 5.1.1,\nGoogle Chrome 15.0.874.121, Mozilla Firefox 3.6, Mozilla Firefox 8, Opera 11.52 and\nInternet Explorer 6).\n\nAuthor\n------\n\nThis plugin was written by and is maintained by Paul Mucur aka \"mudge\". Please\ndo not hesitate to contact me with comments and bug reports through GitHub:\nhttps://github.com/mudge/jquery_example/issues\n\nYou can view the latest source code (and fork the entire project if you wish)\nat http://github.com/mudge/jquery_example\n\nContributors\n------------\n\nThe code to support the Metadata plugin was contributed by DeLynn Berry (http://github.com/delynn).\n\nLicensing\n---------\n\nCopyright (c) Paul Mucur (http://mudge.name), 2007-2014.\n\nDual-licensed under the BSD (BSD-LICENSE.txt) and GPL (GPL-LICENSE.txt)\nLicenses.\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation; either version 2 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nDonations\n---------\n\n[Donations are accepted using Pledgie](http://www.pledgie.com/campaigns/1517)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudge%2Fjquery_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudge%2Fjquery_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudge%2Fjquery_example/lists"}