Home  >  Article  >  Web Front-end  >  How to set width in javascript

How to set width in javascript

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-07-21 14:28:594602browse

You can use the style object to set width in JavaScript, the syntax is "document.getElementById("Element Name").style.width="value"". The Style object represents an individual style declaration, accessible from the document or element to which the style is applied.

How to set width in javascript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

Style object represents a single style declaration. A Style object can be accessed from the document or element to which the style is applied.

Syntax for using Style object properties:

document.getElementById("id").style.property="值"

Style object properties:

  • Background

  • Borders and Margins

  • Layout

  • List

  • Miscellaneous

  • Position

  • Print

  • Scroll bar

  • Form

  • Text

  • Specification

Background Property

How to set width in javascript

Border and Margin properties

How to set width in javascript

Layout property

How to set width in javascript

List property

How to set width in javascript

Positioning attribute

How to set width in javascript

[Recommended learning: javascript advanced tutorial

The above is the detailed content of How to set width in javascript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn