files/en-us/web/api/webglrenderingcontext/getvertexattrib/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGLRenderingContext.getVertexAttrib() method of the
WebGL API returns information about a vertex
attribute at a given position.
getVertexAttrib(index, pname)
index
pname
: A {{domxref("WebGL_API/Types", "GLenum")}} specifying the information to query. Possible values:
gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
gl.VERTEX_ATTRIB_ARRAY_ENABLED
true if the vertex attribute is enabled at this index. Otherwise false.gl.VERTEX_ATTRIB_ARRAY_SIZE
gl.VERTEX_ATTRIB_ARRAY_STRIDE
gl.VERTEX_ATTRIB_ARRAY_TYPE
gl.BYTEgl.UNSIGNED_BYTEgl.SHORT,gl.UNSIGNED_SHORTgl.FLOATgl.VERTEX_ATTRIB_ARRAY_NORMALIZED
index.gl.CURRENT_VERTEX_ATTRIB
index.When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally:
gl.VERTEX_ATTRIB_ARRAY_INTEGER
index.gl.VERTEX_ATTRIB_ARRAY_DIVISOR
When using the {{domxref("ANGLE_instanced_arrays")}} extension:
ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE
Returns the requested vertex attribute information (as specified with
pname).
gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
{{Specifications}}
{{Compat}}