<p>
    The three primary colors of light are
    <span style="color: red;">red</span>,
    <span style="color: green;">green</span>,
    <span style="color: blue;">blue</span>.
</p>
Rendered Output
<p>The title is "<span lang="fr">Le Bon Usage</span>".</p>
<p>
    There is a <span id="target-span" style="background-color: gold;">specific part</span> that can be selected or manipulated with JavaScript.
</p>
<button type="button" id="target-span-btn">Change Text</button>

<script>
  // Using JavaScript, this code changes the text of the targeted span when the button is clicked.
  const btn = document.getElementById("target-span-btn");

  btn.addEventListener("click", () => {
      const targetSpan = document.getElementById("target-span");
      targetSpan.innerText = "Text has been changed";
  });
</script>
Rendered Output Clicking the button demonstrates the actual effect of the JavaScript on the targeted span.
<button type="button" id="toggle-button">
    <!-- Used to apply styles to plain text -->
    <span class="toggle-button-text">Click Me</span>
    <!-- Used purely for visual decoration: arrow display -->
    <span aria-hidden="true" class="toggle-button-arrow"></span>  
</button>
#toggle-button {
    padding: 0.5em 1em;
    background: none;
    border: 1px solid #777;
    border-radius: 0.5em;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.toggle-button-text {
    margin-right: 1em;
}
.toggle-button-arrow { /* Displaying the arrow */
    display: inline-flex;
    width: 0.7em;
    height: 0.7em;
    border-left: 1px solid black;
    border-bottom: 1px solid black;
    transform: rotateZ(-45deg) translateY(-0.3em);
}
Rendered Output