JSFiddle - React, Tailwind, and code Playground

by Adam Pengh

HTML

<!DOCTYPE html>
<html>
    <head>
        <title>DOM Manipulation</title>
    </head>
    <link rel="stylesheet" href="style.css" />
    <body>
        <div id="content">
            <label>Link Name:</label>
            <input type="text" id="linkName">
            <a id="link" href="https://teamtreehouse.com"></a>
        </div>
        <script src="app.js"></script>
    </body>
</html>

JavaScript

const inputElement = document.getElementById('linkName');

inputElement.addEventListener('input', function() {

  let inputValue = document.getElementById('linkName').value;
  document.getElementById('link').textContent = inputValue;

});