{"id":17182139,"url":"https://github.com/prettydiff/getnodesbytype","last_synced_at":"2025-07-13T17:40:18.073Z","repository":{"id":29835903,"uuid":"33380587","full_name":"prettydiff/getNodesByType","owner":"prettydiff","description":"a custom DOM method to get nodes by node type","archived":false,"fork":false,"pushed_at":"2016-12-07T21:10:41.000Z","size":8,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T13:43:55.362Z","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettydiff.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-04-03T20:04:18.000Z","updated_at":"2024-10-18T17:33:52.000Z","dependencies_parsed_at":"2022-08-03T12:30:14.668Z","dependency_job_id":null,"html_url":"https://github.com/prettydiff/getNodesByType","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prettydiff/getNodesByType","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2FgetNodesByType","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2FgetNodesByType/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2FgetNodesByType/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2FgetNodesByType/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettydiff","download_url":"https://codeload.github.com/prettydiff/getNodesByType/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettydiff%2FgetNodesByType/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265180573,"owners_count":23723715,"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":[],"created_at":"2024-10-15T00:36:05.393Z","updated_at":"2025-07-13T17:40:18.028Z","avatar_url":"https://github.com/prettydiff.png","language":"JavaScript","readme":"# getNodesByType\na custom DOM method to get nodes by node type\n\nWhen the code is run a method `getNodesByType` will be attached to all element node types in the current DOM tree and the document object.\n\n##Examples\n###getNodesByType\nExecute the method with either a numeric value or a node type name.\n\n    document.getNodesByType(1);                          // get all element nodes in the document\n    document.getNodesByType(\"TEXT_NODE\");                // get all text nodes in the document\n\n    var item = document.getElementById(\"item\");\n    item.getNodesByType(\"COMMENT_NODE\");                 // get all child comment node types\n    item.getNodesByType(1);                              // get all child element node types\n\n###getElementsByAttribute\nUpdated with a new method: `getElementsByAttribute(name, value)`. Both the name and value arguments of `getElementsByAttribute` are optional.\n\n    document.getElementsByAttribute(\"class\", \"segment\"); // get all elements with a class attribute of value segment\n    document.getElementsByAttribute(\"src\", \"\");          // get all elements with a src attribute of any value\n\n    var item = document.getElementById(\"item\");\n    item.getElementsByAttribute(\"id\");                   // get all child elements with an id attribute of any value\n    item.getElementsByAttribute(\"\", \"purple_alien\");     // get all child elements with any attribute whose value is purple_alien\n\n##Node Types\nHere are the supported node types and their corresponding numeric values:\n\n* 0 - all nodes (non standard)\n* 1 - \"ELEMENT_NODE\"\n* 2 - \"ATTRIBUTE_NODE\"\n* 3 - \"TEXT_NODE\"\n* 4 - \"CDATA_SECTION_NODE\"\n* 5 - \"ENTITY_REFERENCE_NODE\"\n* 6 - \"ENTITY_NODE\"\n* 7 - \"PROCESSING_INSTRUCTION_NODE\"\n* 8 - \"COMMENT_NODE\"\n* 9 - \"DOCUMENT_NODE\"\n* 10 - \"DOCUMENT_TYPE_NODE\"\n* 11 - \"DOCUMENT_FRAGMENT_NODE\"\n* 12 - \"NOTATION_NODE\"\n\nAll of the above node types remain valid types in the W3C specifications, but the WHATWG HTML5 group has deprecated these types:\n\n* 2 - \"ATTRIBUTE_NODE\"\n* 4 - \"CDATA_SECTION_NODE\"\n* 5 - \"ENTITY_REFERENCE_NODE\"\n* 6 - \"ENTITY_NODE\"\n* 12 - \"NOTATION_NODE\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettydiff%2Fgetnodesbytype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettydiff%2Fgetnodesbytype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettydiff%2Fgetnodesbytype/lists"}