ABOUT

Thursday, July 29, 2021

JULY 29, 2021. REPEATING JavaScript

JavaScript has many HTML methods, eg, 'getElementById()':

JavaScript can change HTML content.

Example from Digital Ocean

My favorite poem is The Wide Ocean by Pablo Neruda.


<p id="demo2"></p>
<script>
const poem = "The Wide Ocean";
const author = "Pablo Neruda";

const favePoem = `My favorite poem is ${poem} by ${author}.`;
document.getElementById("demo2").innerHTML = favePoem;
</script>

Read details: Tania Rascia, July 11, 2017, How To Work with Strings in JavaScript, Digitalocean. Retrieved: July 29, 2021 https://www.digitalocean.com/community/tutorials/how-to-work-with-strings-in-javascript


No comments:

Post a Comment

JULY 21, 2025 LEARNING Dylan Thomas' POETRY

I consider today to continue to learn English language, because I feel better after series of illnesses. I will read the poem by Dylan Thoma...