Lompat ke konten Lompat ke sidebar Lompat ke footer

Mengatur Warna Teks Dekorasi HTML textDecorationColor Style DOM

Properti Style textDecorationColor DOM pada HTML merupakan properti yang digunakan untuk mengatur warna dari text-decoration seperti underlines, overlines, dan line-throughs. Properti textDecorationColor juga mengembalikan nilai dari warna text-decoration.


3 Value Properti textDecorationColor Style DOM pada HTML
Properti textDecoration Style DOM

Sebelum memahami lebih dalam materi tentang Mengatur Warna Teks Dekorasi HTML textDecorationColor Style DOM, terlebih dahulu pelajari materi tentang: Mengatur Dekorasi Teks HTML Menggunakan textDecoration Style DOM [klik], Mengatur Posisi Teks HTML Menggunakan textAlignLast DOM [klik], dan Mengatur Arah Teks HTML Menggunakan textAlign Style DOM [klik].

Sintak:
  • mengembalikan nilai properti textDecorationColor: object.style.textDecorationColor
  • mengatur nilai properti textDecorationColor: object.style.textDecorationColor = "color|initial|inherit"

Property Values:
  • color: digunakan untuk menentukan warna dari text decoration.
  • initial: digunakan untuk mengatur nilai properti textDecorationColor ke nilai default-nya.
  • inherit: digunakan untuk menerima nilai turunan properti dari elemen parent.

Return Values: berfungsi untuk mengembalikan sebuah string yang merepresentasikan properti warna text-decoration.

Baca Juga:

Contoh:

<!DOCTYPE html>

<html>

 

<head>

 

<title>

Properti Style 

textDecorationColor DOM

</title>

 

<style>

#mkn1 

{text-decoration: underline;}

</style>

 

</head>

 

<body>

<center>

 

<h1 

style="color:green;

width:40%;">

Blog Elfan

</h1>

 

<h2>

Properti Style 

textDecorationColor DOM

</h2>

 

<p id="mkn1">

Merupakan portal ilmu 

komputer.

</p>

 

<button 

type="button" 

onclick="Bon1s()">

Chanege Decoration

</button>

 

<script>

function Bon1s() 

{

// Mengatur warna underline.

document.getElementById(

"mkn1").style.textDecorationColor =

"magenta";

}

</script>

 

</center>

</body>

 

</html>

Output:

Blog Elfan

Properti Style textDecorationColor DOM

Merupakan portal ilmu komputer.



Contoh:

<!DOCTYPE html>

<html>

 

<head>

 

<title>

Properti Style 

textDecorationColor DOM

</title>

 

<style>

#hoho1 

{text-decoration: underline;}

</style>

 

</head>

 

<body>

<center>

 

<h1 

style="color:green;

width:40%;">

Blog Elfan

</h1>

 

<h2>

Properti 

StylestextDecorationColor DOM

</h2>

 

<p id="hoho1">

Merupakan portal ilmu komputer

</p>

 

<button 

type="button" 

onclick="Bon1s()">

Chanege Decoration

</button>

 

<script>

function Bon1s() 

{

// Pengaturan warna teks 

// dokorasi.

document.getElementById(

"hoho1").style.textDecorationColor =

"green";

}

</script>

 

</center>

</body>

 

</html>

Output:

Blog Elfan

Properti StylestextDecorationColor DOM

Merupakan portal ilmu komputer


Artikel ini didedikasikan kepada: Fariza Shegi Pratama, Fathan Ghifar Ahsani, Ferdy Harish Maulana, Finatul Nur Wahyu Fitri, dan Firdaus Fajar Utsmani.

5 komentar untuk "Mengatur Warna Teks Dekorasi HTML textDecorationColor Style DOM"

  1. Jenis browser seperti apa saja yang dapat digunakan untuk mengaktifkan properti textDecorationColor Style DOM pada HTML?

    BalasHapus
    Balasan
    1. Berikut adalah beberapa jenis browser yang dapat digunakan untuk mengaktifkan properti textDecorationColor Style DOM pada HTML:
      a) Google Chrome 57.0
      b) Firefox 36.0
      c) Opera 44.0
      d) Apple Safari 7.1

      Hapus
  2. Apa yang dimaksud dengan properti textDecorationColor Style DOM pada HTML?

    BalasHapus
    Balasan
    1. Properti textDecorationColor Style DOM pada HTML merupakan properti yang digunakan untuk menentukan warna dekorasi pada teks seperti garis bawah, garis luar, dan garis batas.

      Hapus
    2. Properti textDecorationColor Style DOM pada HTML merupakan properti yang hanya akan berpengaruh pada elemen dengan dekorasi teks yang bernilai visible atau terlihat.

      Hapus

Hubungi admin melalui Wa : +62-896-2414-6106

Respon komentar 7 x 24 jam, mohon bersabar jika komentar tidak langsung dipublikasi atau mendapatkan balasan secara langsung.

Bantu admin meningkatkan kualitas blog dengan melaporkan berbagai permasalahan seperti typo, link bermasalah, dan lain sebagainya melalui kolom komentar.

- Ikatlah Ilmu dengan Memostingkannya -
- Big things start from small things -