locked
Error: TypeError: document.GetElementById is not a function RRS feed

  • Question

  • User53129014 posted

    <script>
    function mudaFoto (foto){
    document.GetElementById('icone').src = foto
    }
    </script>


    <ul type="">
    <li onmouseover="mudaFoto('_imagens/home.png')"><a href="index.html">Home</a></li>

    when the mouse is over, send me this error on console browser: TypeError: document.GetElementById is not a function

    How do i can fix?

    Sunday, June 21, 2020 6:23 PM

Answers

  • User475983607 posted

    JavaScript is case sensitive.  The syntax is is a lower case g.

    document.getElementById('icone').src = foto

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 21, 2020 6:52 PM

All replies

  • User475983607 posted

    JavaScript is case sensitive.  The syntax is is a lower case g.

    document.getElementById('icone').src = foto

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 21, 2020 6:52 PM
  • User53129014 posted

    Thank you very much for answering me

    Sunday, June 21, 2020 7:16 PM