Obiekt Code w DOM HTML

Obiekt Code

Obiekt Code reprezentuje element HTML <code>.

Dostęp do obiektu Code

Możesz użyć getElementById() do uzyskania dostępu do elementu <code>:

var x = document.getElementById("myCode");

Spróbuj sam

Tworzenie obiektu Code

Możesz użyć metody document.createElement() do tworzenia elementów <code>:

var x = document.createElement("CODE");

Spróbuj sam

Standardowe atrybuty i zdarzenia

Obiekt Code obsługuje standardyAtrybutyiZdarzenia.

Strony związane

Kurs HTML:Elementy formatowania tekstu HTML

Przeglądarka HTML:Tag <code> HTML