Using negative values:
document.getElementById("myP").style.wordSpacing = -3px";
<!DOCTYPE html> <html> <body> <p id="myP">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Set word spacing</button> <script> function myFunction() {//from w w w . ja v a 2 s. c o m document.getElementById("myP").style.wordSpacing = "-3px"; } </script> </body> </html>