Chat Application Using HTML, CSS And JavaScript With Source Code
Introduction
Hello developers friends, all of you are welcome to this new and wonderful project. Today we have created a great chatting application in which you can chat. This chatting application is very user friendly and we have created it with the help of HTML CSS and JavaScript. It is very nice to look at, in this application you can talk to the bot and if you ask anything to the bot, it answers you back.
Friends, if you want to use this chatting application then you have to understand the code given below first, then you can use this chatting application.
HTML (index.html)
1. <!DOCTYPE html>: This declaration defines the document type and version of HTML being used (HTML5 in this case).
2. <html lang=”en”>: The root element of the HTML document, indicating that the document is written in English (en stands for English).
3. <head>: This section contains meta-information about the HTML document, such as the character set, viewport settings, and the title of the page.
<meta charset=”UTF-8″>: Specifies the character encoding for the document as UTF-8, which is widely used for supporting various characters.
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>: Sets the viewport properties to control the layout and scaling on different devices.
<title>WhatsApp Chatbox Clone</title>: Sets the title of the web page to “WhatsApp Chatbox Clone.”
<link rel=”stylesheet” href=”styles.css”>: Links an external CSS file named “styles.css” for styling the HTML content.
<link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.1.2/css/material-design-iconic-font.min.css”>: Links an external CSS file for using the Material Design Iconic Font.
<script src=”https://code.jquery.com/jquery-1.12.4.min.js”></script>: Includes the jQuery library from a CDN (Content Delivery Network), which is a JavaScript library to simplify HTML DOM manipulation and event handling.
<script src=’https://code.responsivevoice.org/responsivevoice.js’></script>: Includes the ResponsiveVoice JavaScript library, which provides text-to-speech functionality.
4. <body>: This is the main content of the HTML document.
5. <div class=”chat”>: Represents the container for the entire chat application.
6. <div class=”chat-container”>: Contains the chat-related components.
7. <div id=”call” class=”user-bar”>: Represents the user bar section with various elements like back button, avatar, name, status, and action icons.
<div class=”back”>: Contains a back button icon.
<div class=”avatar”>: Displays the user’s avatar image.
<div class=”name”>: Shows the user’s name and status.
<div class=”actions more”>, <div class=”actions attachment”>, <div class=”actions”>: Contain action icons like more options, attachment, and phone icons.
8. <div class=”conversation”>: Represents the conversation section.
<div class=”conversation-container”>: Contains the actual conversation content.
9. <form id=”form” class=”conversation-compose”>: Contains the input form for composing messages.
<div class=”emoji”>: Placeholder for emoji input.
<input id=”val” class=”input-msg” name=”input” placeholder=”Type a message” autocomplete=”off” autofocus>: Input field for typing messages.
<div class=”photo”>: Contains a camera icon for attaching photos.
<span id=”speak”></span>: Placeholder for speech-related functionality.
<span class=”send”>: Contains a circular icon for sending messages.
10. <script src=”script.js”></script>: Includes an external JavaScript file named “script.js” for scripting functionalities related to the chat application.
whatsapp
console.log = function () { };