Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="container">
  <h1>Simple ChatBot</h1>
  <div class="ask-input">
    <input type="text" id="questionBox" onkeydown="if(event.keyCode == 13){chat()}" placeholder="Ask Your Question Here!">
  <p id="answerBox">Answer will Appear Here</p>


    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    font-family: sans-serif;
    background: url(;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 45%;
    height: 400px;
    padding: 5px;
    color: #fff;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 10px 10px 10px rgba(455,55,68,0.3);
    line-height: 2;
    transform: translateY(-5%);
.container h1{
    font-size: 3rem;
    width: 100%;
    height: 70px;
    overflow: hidden;
    margin-top: 40px;
.ask-input input{
    width: 100%;
    height: 70px;
    border: none;
    padding-left: 30px;
    padding-top: 0;
    outline: none;
    font-size: 1.5rem;
    border-radius: 20px;
    color: black;
.container p{
    font-size: 1.5rem;
    margin-top: 30px;
    color: black;
    text-align: center;


                function chat(){
    let quetions={
        "hi":"hello :)",
        "how are you":"Good :) You say?",
        "i'm also good":"How can i help you!",
        "who are you":"I'm a Chatbot",
        "your favourite language":"Java, but most people hate it :(",
        "okay":"Thanku for being here!",
        "bye":"Okay! see you soon... :)",
    let user=document.getElementById("questionBox").value;
    document.getElementById("answerBox").innerHTML=user + "<br>";
    if(user in quetions){
        document.getElementById("answerBox").innerHTML=quetions[user] +"<br>";
        document.getElementById("answerBox").innerHTML="sorry, its not in my database";