Return the word spacing of a <p> element:
alert(document.getElementById("myP").style.wordSpacing);
<!DOCTYPE html> <html> <body> <p id="myP" style="word-spacing:10px;">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Return word spacing of p</button> <p id="demo"></p> <script> function myFunction() {//from w ww . j a v a 2 s . c o m document.getElementById("demo").innerHTML = document.getElementById("myP").style.wordSpacing; } </script> </body> </html>