Title: javascript in child them
Last modified: May 5, 2020

---

# javascript in child them

 *  Resolved [CyrilBron](https://wordpress.org/support/users/cyrilsource/)
 * (@cyrilsource)
 * [6 years ago](https://wordpress.org/support/topic/javascript-in-child-them/)
 * 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](https://wordpress.org/support/users/cyrilsource/)
 * (@cyrilsource)
 * [6 years ago](https://wordpress.org/support/topic/javascript-in-child-them/#post-12790121)
 * 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](https://wordpress.org/support/users/cyrilsource/).

Viewing 1 replies (of 1 total)

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

 * ![](https://i0.wp.com/themes.svn.wordpress.org/twentytwenty/3.0/screenshot.png)
 * Twenty Twenty
 * [Support Threads](https://wordpress.org/support/theme/twentytwenty/)
 * [Active Topics](https://wordpress.org/support/theme/twentytwenty/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/twentytwenty/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/twentytwenty/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [CyrilBron](https://wordpress.org/support/users/cyrilsource/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/javascript-in-child-them/#post-12790121)
 * Status: resolved