The Style wordSpacing property in HTML DOM used to set the spacing between words. It can also be used to specify space between words. It returns the spacing between the words in a text.
- It returns the wordSpacing property.
- It is used to set the wordSpacing property.
object.style.wordSpacing = "normal|length|initial|inherit"
- normal: This is used to specify normal spacing between words.It is a default value.
- length: This is used to specify space between the words in length units.It can allow negative values.
- intial: It sets the wordSpacing property to its default value.
- inherit: This property is inherited from its parent element.
Return Value: It returns a string representing the space between the words in a text.
- Before clicking on the button:
- After clicking on the button:
Supported Browsers: The browser supported by DOM Style wordSpacing property are listed below:
- Google Chrome
- Internet Explorer
- Apple Safari