Javascript examples for CSS Style Property:wordSpacing
Difference between the wordSpacing property and the letterSpacing property:
<!DOCTYPE html> <html> <body> <p id="myP1">This is an example paragraph.</p> <p id="myP2">This is an example paragraph.</p> <button type="button" onclick="changeLetters()">Set letter spacing</button> <button type="button" onclick="changeWords()">Set word spacing</button> <script> function changeLetters() {/* ww w .j a va2 s . c om*/ document.getElementById("myP1").style.letterSpacing = "15px"; } function changeWords() { document.getElementById("myP2").style.wordSpacing = "15px"; } </script> </body> </html>