Title: Using CSS and JavaScript on a post
Last modified: April 14, 2023

---

# Using CSS and JavaScript on a post

 *  [werner1213](https://wordpress.org/support/users/werner1213/)
 * (@werner1213)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-css-and-javascript-on-a-post/)
 * Dears
   I am an older WP-user, trying to program a visual effect on a new post.
   I am impressed by the way chatGPT displays its text after an enquiry. I asked
   for the code and got this as an answer:
 * Here’s an example of how we can use JavaScript and CSS to create a moving ChatGPT
   response: Then the three code snippets… which cannot be copied into this text.
 * In this example, we first create a………….
   with a class of chatgpt-response and 
   a tag inside of it. We style theand tags with CSS to make the text move across
   the screen. We then use JavaScript to set up an interval that changes the text
   in thetag every 5 seconds. The text is taken from an array of responses, and 
   we cycle through the array using the modulus operator to loop back to the beginning
   once we reach the end.
 * After installing WPCode I created three snippets but did not succeed to put everything
   in order. The new post shows a running text above the site header, even though
   I tried several combinations of placing the snippets.
 * I would appreciate someone to help me on this. Thank you!
 * Werner
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-css-and-javascript-on-a-post%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/using-css-and-javascript-on-a-post/#post-16657388)
 * Maybe you should have asked chatGPT how to do that in WordPress 🙂
 * External JS and CSS files in WP need to be enqueued with PHP code, but WPCode
   presumably does something differently, so I recommend asking in that plugin’s
   dedicated support channel.
 * BTW, a lot of animation effects can be achieved with modern CSS alone. There 
   is often no need for any JS to drive an animation. Animation via JS is “old skool”(
   but still works).

Viewing 1 replies (of 1 total)

The topic ‘Using CSS and JavaScript on a post’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [3 years, 1 month ago](https://wordpress.org/support/topic/using-css-and-javascript-on-a-post/#post-16657388)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
