All language subtitles for 007 Text Manipulation and the Text Content Property.en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Up till now we've seen that we can change the text inside the selected HTML element using this thing

called innerHTML, but there's actually another property that you can tap into,

and it's called the textContent. And it might seem at first glance that they do exactly the same thing,

they basically just change the text of whichever element that we select,

right?

But actually it's slightly different because the innerHTML does exactly what it says on the tin,

it actually gives you the HTML that's in between the element tags.

So for example if I tried to get the current value of the HTML, it's Hello.

But let's go into our code and if I add a strong tag around the word Hello, then I also get the strong

tags. But if I tried the same thing with textContent, then that's kind of exactly what it is,

right?

It just gives you the text content.

So what this means is that if you select the h1 element and then use innerHTML, then it will literally

give you all of the HTML that is inside that element tags, including any other HTML tags.

So this means that if you use innerHTML, you can also add HTML code on the fly.

So, for example, if we wanted our Hello to not only change its text to Good Bye,

but we also wanted that word to be emphasized,

so to be italicized effectively, then we can assign an em tag around the word,

and that goes into the innerHTML of the h1, and you can see that we changed the text and we also

applied that HTML element to the text.

But remember that when you're writing code like this, the HTML also has to go into quotation marks, because

the value has to be a string, because otherwise it's going to think it's Javascript code, and this is

certainly not Javascript code, right?

So remember that when you're changing this, be it innerHTML

or the style value, you always have to specify it as a string.

So have a play around with that and see if that makes sense, and apply some HTML using your Javascript.

And in the next lesson we're going to talk about the last thing that we can manipulate which is the

attributes of each element.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.