{"id":20698851,"url":"https://github.com/rwson/js-selector","last_synced_at":"2026-04-22T01:03:38.024Z","repository":{"id":32958591,"uuid":"36562784","full_name":"rwson/js-selector","owner":"rwson","description":"基于原生js封装的一些快捷选择器","archived":false,"fork":false,"pushed_at":"2015-05-31T02:37:30.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-11T03:41:53.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mcorrigan/salesforce-rest-api-php-wrapper","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rwson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-30T15:04:36.000Z","updated_at":"2015-05-31T02:37:31.000Z","dependencies_parsed_at":"2022-07-25T18:47:30.742Z","dependency_job_id":null,"html_url":"https://github.com/rwson/js-selector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rwson/js-selector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fjs-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fjs-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fjs-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fjs-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rwson","download_url":"https://codeload.github.com/rwson/js-selector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rwson%2Fjs-selector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992439,"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-12-23T02:00:07.087Z","response_time":69,"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-17T00:27:10.172Z","updated_at":"2025-12-24T01:44:35.537Z","avatar_url":"https://github.com/rwson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-selector\n基于原生js封装的一些简单选择器\n\n----------\n####大致可以分下面几种情况讨论\n\t- 简单的id/class/tagName选择器，并且参数中不含特殊字符(\" \",\"\u003e\")，\n\t  就是平常的document.getElement....\n\t- 匿名方法function(){},就丢给window.onload = function(){}处理\n\t- 含有\" \"的，就是下代选择器，先把当前元素取出来，再取出它的子集元素\n\t- 含有\"\u003e\"的，就是亲子代选择器，同样先把当前元素取出来，再取出它的子\n\t  集元素，同时要保证它的子集元素的父节点就是当前节点才能通过\n\n\n----------\n####API\n\t我们可以使用下面几种选择器\n\t$s(\"#test-id\")\n\t$s(\".test-class\")\n\t$s(\"p\")\n\t$s(\".test-children #children2 .children2-1\")\n\t$s(\".test-children #children2 p\")\n\t$s(\".test-first-child\u003e.first-child2\")\n\t$s(\".test-first-child\u003ediv p\")\t\n\n会返回一个对象,取出具体元素集合需用$(\"p\").elements来取。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwson%2Fjs-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frwson%2Fjs-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frwson%2Fjs-selector/lists"}