0

How do I access the input with the id 'createTitle'. No matter what I try I keep getting null instead of the actual input.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <div id="createArticle”>
        <label for=‘createTitle’>Title</label>
        <input type="text" id=“createTitle” value='title' >
        <br>
        <label for=“createContent”>Content</label>
        <textarea type="text" id=‘createContent’></textarea>
        <button onclick='createArticle()'>Create</button>
    </div>
    <section id='articles'>
        <h1>Articles List</h1>
    </section>
    <script >
        function  createArticle(){
            console.log(document.getElementById('createTitle'))
        }
    </script>
</body>
</body>
</html>`

0 Answers0