Note: This feature is available in Web Workers.
The WebGLRenderingContext.getAttribLocation() method of the WebGL API returns the location of an attribute variable in a given WebGLProgram.
getAttribLocation(program, name)programA WebGLProgram containing the attribute variable.
nameA string specifying the name of the attribute variable whose location to get.
A GLint number indicating the location of the variable name if found. Returns -1 otherwise.
gl.getAttribLocation(program, "vColor");