width property

Gets the width, in CSS pixels, of a given box of text.

HTML Canvas 2D Context, Section 11Internet Explorer 9

Syntax

JavaScript

p = object.width

Property values

Type: number

Width of the given text, in CSS pixels.

Standards information

See also

CanvasTextMetrics
measureText

 

 

Show:
© 2014 Microsoft