Languages
[Edit]
EN

JavaScript - make element resizable (using style property)

0 points
Created by:
ArcadeParade
666

In this article, we would like to show you how to make an existing element resizable using JavaScript.

Quick solution:

 

Practical examples

Edit

1. Resizable element in both directions

Edit

In this example, we set resize CSS property value to both using JavaScript, so we can resize the element both vertically and horizontally.

2. Horizontal only

Edit

In this example, we set resize CSS property value to horizontal using JavaScript, so we can resize the element horizontally.

3. Vertical only

Edit

In this example, we set resize CSS property value to vertical using JavaScript, so we can resize the element vertically.

References

Edit
  1. resize - CSS: Cascading Style Sheets | MDN
  2. Document.querySelector() - Web APIs | MDN

Alternative titles

  1. JavaScript - make existing div element resizable vertically and horizontally (using style property)
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join