{"id":13519527,"url":"https://github.com/kylebarrow/chibi","last_synced_at":"2026-02-18T22:37:30.457Z","repository":{"id":56337428,"uuid":"4778575","full_name":"kylebarrow/chibi","owner":"kylebarrow","description":"A tiny JavaScript micro-library","archived":false,"fork":false,"pushed_at":"2020-11-13T15:36:17.000Z","size":132,"stargazers_count":577,"open_issues_count":7,"forks_count":51,"subscribers_count":27,"default_branch":"master","last_synced_at":"2026-01-24T21:30:31.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/kylebarrow.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}},"created_at":"2012-06-25T06:30:21.000Z","updated_at":"2026-01-22T01:21:55.000Z","dependencies_parsed_at":"2022-08-15T16:50:47.063Z","dependency_job_id":null,"html_url":"https://github.com/kylebarrow/chibi","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/kylebarrow/chibi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarrow%2Fchibi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarrow%2Fchibi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarrow%2Fchibi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarrow%2Fchibi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylebarrow","download_url":"https://codeload.github.com/kylebarrow/chibi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarrow%2Fchibi/sbom","scorecard":{"id":575186,"data":{"date":"2025-08-11","repo":{"name":"github.com/kylebarrow/chibi","commit":"14e82417acc4eb435d1d713142fb699c317e539b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T17:29:09.707Z","repository_id":56337428,"created_at":"2025-08-20T17:29:09.707Z","updated_at":"2025-08-20T17:29:09.707Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29597308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-08-01T05:02:00.128Z","updated_at":"2026-02-18T22:37:30.428Z","avatar_url":"https://github.com/kylebarrow.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript library"],"sub_categories":[],"readme":"# Chibi v3.0.9\n\n#### A tiny JavaScript micro-library\n\nThink it's OK to serve up 30KB over 3G just to manipulate a couple of DOM elements? Of course you don't because that's an asshat move and you're no asshat. You'll probably instead use a couple of lines of vanilla JavaScript, perhaps a little CSS `:active` with transitions, all while riding a unicorn bareback through a double rainbow, no hands.\n\nWorking on something a wee bit more complex? Unlike fat, grown-up frameworks and libraries, Chibi focuses on just the essentials, melted down and mixed with optimisation rainbows to create a really light micro-library that allows you to do awesome things, asshatory free.\n\n### The sweet, juicy bits\n\n* Chibi is really tiny: 7KB minified, 3KB gzipped, small enough to stick inline on single page web apps, saving an extra HTTP request.\n* Supports modern desktop and mobile browsers including Chrome, Firefox, Internet Explorer, Opera and Safari (see Browser Support below).\n* Even supports creaky old browsers like IE6, I don't know why you would do this.\n* No animation cruft, instead use CSS transitions like a nice person.\n* In modern browsers, Chibi typically executes DOM manipulation 20% to 50% faster than grown-up libraries.\n\n### The lumpy, chewy bits\n\n* Chibi's polyfill for `document.querySelectorAll()` is limited to browser CSS support and is not as fast as some dedicated selector engines. This means no `input[type=text]` or `p:nth-child(even)` selectors with IE6. Fortunately modern browser don't need this polyfill.\n* Ancient browsers that support neither `document.querySelectorAll()` nor `window.getComputedStyle` can bugger off.\n\n**Version 3 is a major update with many breaking changes. If it's difficult to embrace change, version 1 is still available [here](https://github.com/kylebarrow/chibi/tree/1.1.5).**\n\n### Browser Support\n\nChibi has been tested with and supports the following browsers:\n\n* Android Browser 2.1 or higher\n* Blackberry Browser 6 or higher\n* Chrome\n* Chrome Android\n* Firefox 3.5 or higher\n* Firefox Mobile\n* Internet Explorer 6 or higher\n* Internet Explorer Mobile 9 or higher\n* Opera 10 or higher\n* Opera Mini\n* Opera Mobile 10 or higher\n* Safari 3.2 or higher\n* Safari Mobile 3.2 or higher\n* Symbian^3 Browser or higher\n\nChibi should also work with any other browser that supports `document.querySelectorAll()`.\n\n### Installation\n\nGrab it from [here](https://github.com/kylebarrow/chibi/) or\n\n```shell\nnpm install chibijs\n```\n\n### Using Chibi\n\nChibi syntax is similar to that pioneered by jQuery: `$(selector).method()`. It intentionally uses the same `$` namespace as jQuery because micro-libraries and grown-up libraries should never mix.\n\nChibi's supports standard CSS selectors but you can also pass in DOM elements directly:\n\n##### CSS selector\n\n```js\n$(\"p\") // Returns an array of all paragraph elements\n$(\"p\").hide() // Hides all paragraphs\n$(\"#foo\").show() // Shows element with id equal to \"foo\"\n$(\".foo\").hide() // Hides elements with \"foo\" CSS class\n```\n\n##### A DOM element selector, pointless\n\n```js\n$(document.getElementsByTagName('p')).hide() // Hides all paragraphs\n```\n\n##### A more interesting DOM element selector\n\n```js\n$($('p')[0]).hide() // Hides first paragraph\n```\n\n### Methods\n\nChibi supports method chaining `$(selector).method().anothermethod().evenmoremethods()` of any method not returning a value (string, boolean, etc.).\n\n#### $().ready(handler)\n*Fires handler when the DOM is ready.*\n\nUse to fire a function when the DOM is ready. Including a selector makes no sense for this method, don't do it.\n\n```js\n$().ready(function(){\n\t// Do awesome\n});\n```\nor perhaps\n\n```js\nfunction foo() {\n\t// Do awesome\n}\n\n$().ready(foo);\n```\n\n#### $().loaded(handler)\n*Fires handler when the page is loaded.*\n\nUse to fire a function when the page is loaded. Including a selector makes no sense for this method, don't do it.\n\n```js\nfunction foo() {\n\t// Do awesome\n}\n\n$().loaded(foo);\n```\n\n#### $(selector).each(function)\n*Executes a function on each matching element*\n\n**each** passes each matching element to the specified function.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\tfunction foo(elm) {\n\t\telm.style.color = \"red\";\n\t}\n\n    $('p').each(foo); // Executes the foo function (sets the element style color to red) on all paragraph elements\n    \n    // An alternative way to achieve the above\n    $('p').each(function(elm) {\n\t\t$(elm).css('color','red');  \n    })\n    \n    \n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).first()\n*Finds the first matching element.*\n\n**first** will return an array containing the first matching element, useful when working with crappy browsers like IE6 with weak CSS pseudo support, especially when combined with method chaining.\n\n#### $(selector).last()\n*Finds the last matching element.*\n\n**last** will return an array containing the last matching element.\n\n#### $(selector).odd()\n*Finds matching odd elements.*\n\n**odd** will return an array containing matching odd elements.\n\n#### $(selector).even()\n*Finds matching even elements.*\n\n**even** will return an array containing matching even elements.\n\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n    $('p').first(); // returns an array containing the first paragraph element\n    $('p').last(); // returns an array containing the fourth paragraph element\n    $('p').odd(); // returns an array of odd paragraph elements\n    $('p').even(); // returns an array of even paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).hide()\n*Hides matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').hide(); // hides all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).show()\n*Shows matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\np {display:none}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').show(); // shows all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).toggle()\n*Toggles visibility of matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp style=\"display:none\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').toggle(); // shows the second paragraph element, hides the first paragraph element\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).remove()\n*Removes matching elements from the DOM tree.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').remove(); // removes all the paragraph elements from the DOM tree\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).css(property, value)\n*Gets or optionally sets the CSS property for matching elements.*\n\n**css** with no *value* will return the CSS property string of the first matching element found. **css** will return the computed property value if the property isn't explicitly set which can vary between browsers. For example, an element with no explicit font weight will return 'normal' in Opera and Webkit browsers but '400' in Firefox and Internet Explorer browsers.\n\n*value* will set the value of the CSS property for all matching elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"bold\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').css('font-weight'); // returns the \"font-weight\" of the first paragraph element\n\t$('p').css('color','red'); // sets all paragraph elements color to red\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).getClass()\n*Gets class for first matching element found.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cdiv class=\"red\"\u003eFoo\u003c/div\u003e\n\u003cdiv class=\"mono\"\u003eBar\u003c/div\u003e\n\u003cp \u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('div').getClass(); // returns 'red', the class of the first div element\n\t$('p').getClass(); // returns undefined as the first paragraph element has no class set\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).setClass(class)\n*Sets the class of all matching elements replacing any existing element class with this class.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').setClass('red bold'); // sets the class to \"red\" and \"bold\" for all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).addClass(class)\n*Adds a class to all matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').addClass('mono'); // adds the \"mono\" class to all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).removeClass(class)\n*Removes class from all matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').removeClass('mono'); // removes the \"mono\" class from all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).toggleClass(class)\n*Toggles class for matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').toggleClass('mono'); // toggles the mono class on all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).hasClass(class)\n*Returns true if first matching element found includes the class.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n.bold {font-weight:900}\n.red {color:red}\n.mono {font-family:monospace}\n\u003c/style\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cdiv class=\"red\"\u003eFoo\u003c/div\u003e\n\u003cdiv class=\"mono\"\u003eBar\u003c/div\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp class=\"mono\"\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('div').cls('red'); // returns true as the first div element includes the 'red' class\n\t$('p').cls('mono'); // returns undefined as the first paragraph element doesn't include the 'mono' class\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).html(html)\n*Gets or optionally sets the inner HTML of matching elements.*\n\n**html** with no arguments will return the HTML string of the first matching element found.\n\nIf the *html* argument is specified, this will replace the inner HTML of all matching elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').html(); // returns an inner HTML \"Foo\" of the first paragraph element\n\t$('p').html('\u003ci\u003eFoobar\u003c/i\u003e'); // Sets the inner HTML of all paragraph elements to \"\u003ci\u003eFoobar\u003c/i\u003e\"\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).htmlBefore(value)\n*Inserts html before all matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').htmlBefore('\u003ci\u003eFoobar\u003c/i\u003e'); // Inserts \"\u003ci\u003eFoobar\u003c/i\u003e\" before all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).htmlAfter(value)\n*Inserts html after all matching elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').htmlAfter('\u003ci\u003eFoobar\u003c/i\u003e'); // Inserts \"\u003ci\u003eFoobar\u003c/i\u003e\" after all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).htmlAppend(value)\n*Inserts html after all matching elements inner elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').htmlAppend('\u003ci\u003eFoobar\u003c/i\u003e'); // Inserts \"\u003ci\u003eFoobar\u003c/i\u003e\" after all paragraph child elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).htmlPrepend(value)\n*Inserts html before all matching elements inner elements.*\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').htmlPrepend('\u003ci\u003eFoobar\u003c/i\u003e'); // Inserts \"\u003ci\u003eFoobar\u003c/i\u003e\" before all paragraph child elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).attr(property, value)\n*Gets or optionally sets the property for all matching elements.*\n\n**attr** with no value argument will return the property string of the first matching element found.\n\n*value* will set the value of the property for all matching elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003e\u003ca href=\"http://en.wikipedia.org/wiki/Foobar\"\u003eFoobar\u003c/a\u003e\u003c/p\u003e\n\u003cscript\u003e\n\t$('a').attr('href'); // returns the \"href\" property value \"http://en.wikipedia.org/wiki/Foobar\" of the first link element\n\t$('a').attr('target','_blank'); // sets the \"target\" property for all link elements to \"_blank\"\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).data(key, value)\n*Gets or optionally sets the data key value for all matching elements.*\n\n**data** with no *value* argument will return the data key value of the first matching element found.\n\n*value* will set the value of the data key for all matching elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp data-test=\"foo\"\u003e\u003c/p\u003e\n\u003cp data-test=\"bar\"\u003e\u003c/p\u003e\n\u003cscript\u003e\n\t$('p').data('test'); // returns \"foo\" for data key \"test\" of first paragraph element found\n\t$('p').data('test','foobar'); // sets the date key \"test\" value to \"foobar\" on all matching paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).val(value)\n*Gets or optionally sets the value of matching form elements.*\n\n**val** with no arguments will return the value string of the first matching form element found. For select lists, Chibi will return the selected option value string, if any. For select lists with multiple selects, Chibi will return an array of selected option value strings, if any.\n\n*value* will set the value of matching form field elements. For select lists, this will select the option matching this value. For select lists with multiple selects, passing an array of values will select all options in the select list matching these values.\n\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cform\u003e\n\u003cinput type=\"text\" value=\"Foobar\" name=\"text\"\u003e\n\u003cselect multiple=\"multiple\"\u003e\n\t\u003coption value=\"foo\"\u003eFoo\u003c/option\u003e\n\t\u003coption value=\"bar\" selected=\"selected\"\u003eBar\u003c/option\u003e\n\u003c/select\u003e\n\u003c/form\u003e\n\u003cscript\u003e\n\t$('input').val(); // returns \"Foobar\"\n\t$('input').val('Foo Bar'); // sets the value for all input elements to \"Foo Bar\"\n\t$('select').val(); // returns \"bar\", the selected option value \n\t$('select').val('foo'); // selects the option matching \"foo\"\n\t$('select').val(['foo','bar']); // selects the options matching \"foo\" or \"bar\" values\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).checked(boolean)\n*Gets or optionally sets checked status of checkbox or radio elements.*\n\n**checked** with no arguments will return the checked boolean of the first matching element found.\n\n*boolean* will set the checked status of matching checkbox or radio elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cform\u003e\n\u003cinput type=\"checkbox\" value=\"Foobar\" name=\"chk\"\u003e\n\u003c/form\u003e\n\u003cscript\u003e\n\t$('input').checked(true); // checks the checkbox\n\t$('input').checked(); // returns true\n\t$('input').checked(false); // unchecks the checkbox\n\t$('input').checked(); // returns false\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).on(event, listener)\n*Adds an event listener to all matching elements.*\n\n**on** adds an event listener to all matching elements. There is no need to use the HTML event format ('on' + event) as Chibi will automatically prefix the event as required. **on** also supports passing `window` and `document` as the selector.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\tfunction foo() {\n\t\t// Do awesome\n\t}\n\n\t$('p').on('click',foo); // adds the 'foo' click event listener to all paragraphs\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).off(event, listener)\n*Removed an event listener from all matching elements.*\n\n**off** removed an event listener from all matching elements. There is no need to use the HTML event format ('off' + event) as Chibi will automatically prefix the event as required. **off** also supports passing `window` and `document` as the selector.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cp\u003eFoo\u003c/p\u003e\n\u003cp\u003eBar\u003c/p\u003e\n\u003cscript\u003e\n\tfunction foo() {\n\t\t// Do awesome\n\t}\n\n\t$('p').on('click',foo); // adds the 'foo' click event listener to all paragraph elements\n\t$('p').off('click',foo); // removes the 'foo' click event listener from all paragraph elements\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).get(url, callback, nocache, nojsonp)\n*Sends a GET AJAX request, optionally firing a callback with the XHR `responseText` and `status`. Alias of $(selector).ajax with GET method*\n\nWhen *nocache* is true, a `_ts` time stamp is added to the URL to prevent caching, yes, I'm looking at you Android Browser and iOS 6.\n\n**get** supports JSON as a selector ({name:value}), useful for when you want to send data without using form elements.\n\nFor cross-domain requests, **get** uses JSONP by default but this is overridden when *nojsonp* is true. JSONP requests will apply any *callback* to `callback=?` or similar in the **get** url.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cform\u003e\n\u003cinput type=\"text\" value=\"Foobar\" name=\"text\"\u003e\n\u003c/form\u003e\n\u003cscript\u003e\n\t// XHR all form data using \"GET\" to \"ajax.html\"\n\t$('form').get('ajax.html');\n\n\t// XHR the JSON using \"GET\" to \"ajax.html\"\n\t$({text:'Foo Bar'}).get('ajax.html');\n\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n\t// JSONP\n\t$().get('https://api.github.com/users/kylebarrow/repos?sort=created\u0026direction=asc\u0026callback=?',function(data,status){\n\t\t// Do awesome\n\t});\n\n\t// JSONP with JSON query\n\t$({sort: \"created\", direction: \"asc\", callback: \"?\"}).get('https://api.github.com/users/kylebarrow/repos',function(data,status){\n\t\t// Do awesome\n\t});\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).post(url, callback, nocache)\n*Sends a POST AJAX request, optionally firing a callback with the XHR `responseText` and `status`. Alias of $(selector).ajax with POST method*\n\nWhen *nocache* is true, a `_ts` time stamp is added to the URL to prevent caching.\n\n**post** supports JSON as a selector ({name:value}), useful for when you want to send data without using form elements.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cform\u003e\n\u003cinput type=\"text\" value=\"Foobar\" name=\"text\"\u003e\n\u003c/form\u003e\n\u003cscript\u003e\n\t// XHR the JSON using \"POST\" to \"ajax.html\"\n\t$({text:'Foo Bar'}).post('ajax.html');\t\n\t\n\t// XHR all form data using \"POST\" to \"ajax.html\", returns responseText and status, adds a cache busting time stamp\n\t$('form').post('ajax.html',function(data,status){\n\t\t// Do awesome\n\t},true);\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### $(selector).ajax(url, method, callback, nocache, nojsonp)\n*Sends an AJAX request, optionally firing a callback with the XHR `responseText` and `status`*\n\n**ajax** uses the GET method if none is specified. When *nocache* is true, a `_ts` time stamp is added to the URL to prevent caching.\n\n**ajax** supports JSON as a selector ({name:value}), useful for when you want to send data without using form elements.\n\nFor cross-domain requests, **ajax** uses JSONP by default but this is overridden when *nojsonp* is true. JSONP requests will apply any *callback* to `callback=?` or similar in the **ajax** url. The *method* is obviously always `GET` for JSONP requests.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cform\u003e\n\u003cinput type=\"text\" value=\"Foobar\" name=\"text\"\u003e\n\u003c/form\u003e\n\u003cscript\u003e\n\t// XHR all form data using \"GET\" to \"ajax.html\"\n\t$('form').ajax('ajax.html');\n\n\t// XHR the JSON using \"GET\" to \"ajax.html\"\n\t$({text:'Foo Bar'}).ajax('ajax.html');\n\n\t// XHR all form data using \"POST\" to \"ajax.html\", returns responseText and status, adds a cache busting time stamp\n\t$('form').ajax('ajax.html',\"POST\",function(data,status){\n\t\t// Do awesome\n\t},true);\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cscript src=\"chibi-min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003cscript\u003e\n\t// JSONP\n\t$().ajax('https://api.github.com/users/kylebarrow/repos?sort=created\u0026direction=asc\u0026callback=?','GET',function(data,status){\n\t\t// Do awesome\n\t});\n\n\t// JSONP with JSON query\n\t$({sort: \"created\", direction: \"asc\", callback: \"?\"}).ajax('https://api.github.com/users/kylebarrow/repos','GET',function(data,status){\n\t\t// Do awesome\n\t});\n\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Modify, build, contribute\n\n```shell\nnpm install\ngulp\n```\n\n##### FIN\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarrow%2Fchibi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylebarrow%2Fchibi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarrow%2Fchibi/lists"}