MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / getContainer

Function getContainer

libraries/p5.dom.js:159–170  ·  view source on GitHub ↗

* Helper function for select and selectAll

(p)

Source from the content-addressed store, hash-verified

157 * Helper function for select and selectAll
158 */
159 function getContainer(p) {
160 var container = document;
161 if (typeof p === 'string' && p[0] === '#'){
162 p = p.slice(1);
163 container = document.getElementById(p) || document;
164 } else if (p instanceof p5.Element){
165 container = p.elt;
166 } else if (p instanceof HTMLElement){
167 container = p;
168 }
169 return container;
170 }
171
172 /**
173 * Helper function for getElement and getElements.

Callers 1

p5.dom.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected