• Resolved CyrilBron

    (@cyrilsource)


    Hello everybody,

    I’m developing a web site on my localhost.

    I created a child theme from TwentyTwenty

    Now I would like to include my own scripts in a javascript file in the child theme. I can see my javascript file on the console. If I make console.log(‘hello world’), I can see hello world on the console

    On the other hand, it’s not possible to select classes. By example, if I make

    console.log(document.querySelector('.site-description'))

    I have null on the console

    I don’t understand the problem
    Do I forget something ?

    Thanks and take care,

    Cyril

Viewing 1 replies (of 1 total)
  • Thread Starter CyrilBron

    (@cyrilsource)

    Hello everybody,

    I found the problem

    I had to put my script in a function and call the function in my footer

    all the best,

    Cyril

    • This reply was modified 6 years ago by CyrilBron.
Viewing 1 replies (of 1 total)

The topic ‘javascript in child them’ is closed to new replies.