Q:

Why is my code not working?

I just wrote this code and when I tested it, the javascript wouldn't work.
I have javascript enabled and I tried with a different code and it worked. I think there's maybe a bug but I can't see it.
<!DOCTYPE html>
<html>
<body>
    <p id=“id”>Some Text</p>
    <script>
        document.getElementById(“id”).innerHTML=“Different Text”;
    </script>
</body>
</html>

A:

You are using smart quotes (“”) instead of normal quotes (""). Replace the quotes and it will work.
<p id="id">Some Text</p>
<script>
    document.getElementById("id").innerHTML="Different Text";
</script>

Perhaps this is because you are using a word processor, not an IDE?

