gpt-3.5-turbo-0301· openai
Suzhen/CodeChat
create a html that can chage the background colour when the users click
- User
create a html that can chage the background colour when the users click
- Assistant
- User
sort the code in HTML, CCS and JS
- Assistant
HTML:
code<!DOCTYPE html> <html> <head> <title>Sorting Example</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Sorting Example</h1> <div> <label for="numbers">Enter a list of numbers:</label> <input type="text" id="numbers" placeholder="Ex. 3, 5, 1, 4, 2"> <button onclick="sortNumbers()">Sort</button> </div> <div> <p>Sorted numbers:</p> <p id="sortedNumbers"></p> </div> <script src="script.js"></script> </body> </html>CSS:
code - User
create a html that can change the background colour when the users click, sorting the code in HTML, CCS and JS
- Assistant
HTML:
code<!DOCTYPE html> <html> <head> <title>Color Changer</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Click anywhere to change the background color!</h1> <div onclick="changeColor()" style="height: 500px;"></div> <script src="script.js"></script> </body> </html>CSS:
codebody { background-color: #f1c40f; } h1 { text-align: center; } div { margin: 20px; background-color: #3498db; cursor: pointer; }JS:
code