All language subtitles for 183 Adding and Removing Elements with jQuery.en_US

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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
fr French
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

Now while our web site is live and running we can actually use jQuery to

add new elements on the fly. Now

for example if I selected my h1 and I decided to add a new button before the h1, then I simply use

the before method.

And inside these parentheses I can put down the HTML that I want to add before our h1.

So let's create a button that simply says New, and let's create the closing tag.

And now if I hit enter you can see that we've created a brand new button on our web page without changing

any of our HTML code inside Atom.

So that means that we can create HTML elements at any time we wish

just by using code. But there's actually a few ways that you can do this.

So previously I showed you how you can use the before.

Now there's also after which creates our HTML elements after the element that we've selected.

So in this case it creates it here after h1.

Now there's also prepend and append, and the difference between, say, prepend and before is that prepend

will

add your new HTML element into the item that you've selected just after the opening tag.

So if you go ahead and inspect on this new button you can see that it's been added inside the h1, just

before the word Hello.

And the button that we appended got added just after the content of the h1,

but before the end of the h1.

So using before, after, prepend and append, we have a lot of control over where our newly created HTML

element is going to go.

So just as a reminder the before method will add your new element before the opening tag of the selected

element,

so in this case it was our h1, and the after method will add it after the h1, but the prepend and append

are a little bit special.

They’ll add your element just before the content of the h1 and right after the opening tag, and append does

the opposite where it gets added after the content of your h1 but still inside the h1 element.

Now if you wanted to remove elements it's also really really simple.

All you have to do is just use our dollar sign to select the elements that you want to remove.

For example say if we wanted to get rid of all of our buttons then we can simply select all of them

and say .remove, and that will get rid of all of the button elements inside our current web page.

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