{"id":12786459,"date":"2020-05-05T18:31:28","date_gmt":"2020-05-05T18:31:28","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/javascript-in-child-them\/"},"modified":"2020-05-05T18:31:28","modified_gmt":"2020-05-05T18:31:28","slug":"javascript-in-child-them","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/javascript-in-child-them\/","title":{"rendered":"javascript in child them"},"content":{"rendered":"<p>Hello everybody,<\/p>\n<p>I&#8217;m developing a web site on my localhost.<\/p>\n<p>I created a child theme from TwentyTwenty<\/p>\n<p>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(&#8216;hello world&#8217;), I can see hello world on the console<\/p>\n<p>On the other hand, it&#8217;s not possible to select classes. By example, if I make <\/p>\n<p><code>console.log(document.querySelector(&#039;.site-description&#039;))<\/code><\/p>\n<p>I have null on the console<\/p>\n<p>I don&#8217;t understand the problem<br \/>\nDo I forget something ?<\/p>\n<p>Thanks and take care,<\/p>\n<p>Cyril<\/p>\n","protected":false},"template":"","class_list":["post-12786459","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12786459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12786459\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12786459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}