Thursday, December 6, 2012

style.textIndent

Properti style.textIndent digunakan untuk menetapkan indentation bagi teks di baris pertama di dalam suatu blok teks.

Sintaks:

obj.style.textIndent: value;

Nilainya:

Contoh:

<HTML> <HEAD> <TITLE>style.textIndent</TITLE> <SCRIPT TYPE="text/javascript"> function changeIndent() { document.getElementById("myp").style.textIndent = "80px"; } </SCRIPT> </HEAD> <BODY> <P ID="myp">Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</P> <BUTTON TYPE="button" ONCLICK="changeIndent()">Change Indent!</BUTTON> </BODY> </HTML>