Javascript - Change element TEXT by ID using onclick event

preview_player
Показать описание
A simple video showing how to change the TEXT of an element by assigning it an ID and using the click of a button.

In this example we will be changing the text of a p tag, it will display some text and once the button is clicked display different text.

Comment below if you have any other questions and I'll be more than happy to help you out. Also comment below for any future videos you would like to see!

SUBSCRIBE!
Рекомендации по теме
Комментарии
Автор

But if I want to set a <p>'s text to the current year each time the site refreshes? How do I do?

darkerbogg
Автор

Nice, but what if i want to switch back the original text without having to refresh. How do i achieve it

nkosinathisola
Автор

this inline and embedded scripting is so obsolete these days. guys dont learn this way .!

Anniek
welcome to shbcf.ru