Change Text Inside an Element Using jQuery, jQuery in freeCodeCamp

preview_player
Показать описание
In this challenge we learn how to change text in our html by using jQuery. We find out that we can use our selector to select the element we want to change, then apply the .html function and pass in the new text we want to add, doing so will completely replace the content with the passed in content.
Рекомендации по теме
Комментарии
Автор

Thanks for explaining it so simply. I always try to figure it out on my own first, and if I do get stuck i come to your walk-throughs. Really helps! 👍

lightpinkaura
Автор

what if we have elements with same class name how to target each using index , $(".same")[0].text()='new line' why is this not working to specifically target only the first element to change its text among other elements with the same class named ''same''?

samiRediAmaniTekeshAlazar
Автор

Ehi, can i ask you please why we need to use the tags <em> </em>?

Miriel_Lind
Автор

its getting more difficult now :/ Thanks for your help.

wrc