MooTools Style Properties - MooTools

What is MooTools Style Properties?

MooTools presents a few unique strategies to set and get style property values for DOM factors. We use one of kind fashion properties which include width, height, background shade, font weight, font color, border, etc. via setting and getting distinct values to these fashion houses, we will present HTML elements in unique patterns.

Set and Get style properties

MooTools library includes one of kind strategies that are used to set or get the price of a particular style property or more than one style properties.

setStyle()

This approach lets in you to set the value for a single property of DOM element. This method will work on the selector object of a specific DOM element. Allow us to take an example that provides a background color for div element. Take a look at the following code.

Example

You will receive the following output −

Output

MooTools Style properties

getStyle()

getStyle() method is to retrieve the value of a style property of an element. Let us take an example that retrieves the background-color of a div named body_wrap. Take a look at the following syntax.

Syntax

Multiple Style Properties

MooTools library contains different methods used to set or get the value of a particular style property or multiple style properties.

setStyle()

If you want to set multiple style properties on a single element or an array of elements then you have to use the setStyle() method. Take a look at the following syntax of the setStyle() method.

Syntax

Example

You will receive the following output −

Output

MooTools Style Properties
Try these buttons on the web page, you can see the difference with the div size.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

MooTools Topics