2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								id: 587d7faf367417b2b2512be9
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								title: Post Data with the JavaScript XMLHttpRequest Method
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								challengeType: 6
							 
						 
					
						
							
								
									
										
										
										
											2019-08-05 09:17:33 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								forumTopicId: 301504
							 
						 
					
						
							
								
									
										
										
										
											2021-01-13 03:31:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								dashedName: post-data-with-the-javascript-xmlhttprequest-method
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# --description--
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								In the previous examples, you received data from an external resource. You can also send data to an external resource, as long as that resource supports AJAX requests and you know the URL.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								JavaScript's `XMLHttpRequest`  method is also used to post data to a server. Here's an example:
							 
						 
					
						
							
								
									
										
										
										
											2019-05-14 05:04:05 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const xhr = new XMLHttpRequest();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								xhr.open('POST', url, true);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								xhr.onreadystatechange = function () {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  if (xhr.readyState === 4 & &  xhr.status === 201){
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    const serverResponse = JSON.parse(xhr.response);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    document.getElementsByClassName('message')[0].textContent = serverResponse.userName + serverResponse.suffix;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								};
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								const body = JSON.stringify({ userName: userName, suffix: ' loves cats!' });
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								xhr.send(body);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-05 11:25:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								You've seen several of these methods before. Here the `open`  method initializes the request as a `POST`  to the given URL of the external resource, and uses the `true`  Boolean to make it asynchronous. The `setRequestHeader`  method sets the value of an HTTP request header, which contains information about the sender and the request. It must be called after the `open`  method, but before the `send`  method. The two parameters are the name of the header and the value to set as the body of that header. Next, the `onreadystatechange`  event listener handles a change in the state of the request. A `readyState`  of `4`  means the operation is complete, and a `status`  of `201`  means it was a successful request. The document's HTML can be updated. Finally, the `send`  method sends the request with the `body`  value, which the `userName`  key was given by the user in the `input`  field.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# --instructions--
  
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-05 11:25:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Update the code so it makes a `POST`  request to the API endpoint. Then type your name in the input field and click `Send Message` . Your AJAX function should replace `Reply from Server will be here.`  with data from the server. Format the response to display your name appended with the text ` loves cats` .
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# --hints--
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Your code should create a new `XMLHttpRequest` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(code.match(/new\s+?XMLHttpRequest\(\s*?\)/g));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-05 11:25:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Your code should use the `open`  method to initialize a `POST`  request to the server.
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(code.match(/\.open\(\s*?('|")POST\1\s*?,\s*?url\s*?,\s*?true\s*?\)/g));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Your code should use the `setRequestHeader`  method.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  code.match(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /\.setRequestHeader\(\s*?('|")Content-Type\1\s*?,\s*?('|")application\/json;\s*charset=UTF-8\2\s*?\)/g
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Your code should have an `onreadystatechange`  event handler set to a function.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(code.match(/\.onreadystatechange\s*?=/g));
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-05 11:25:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Your code should get the element with class `message`  and change its `textContent`  to `userName loves cats` 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  code.match(
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    /document\.getElementsByClassName\(\s*?('|")message\1\s*?\)\[0\]\.textContent\s*?=\s*?.+?\.userName\s*?\+\s*?.+?\.suffix/g
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Your code should use the `send`  method.
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								assert(code.match(/\.send\(\s*?body\s*?\)/g));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# --seed--
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## --seed-contents--
  
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```html
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< script >  
						 
					
						
							
								
									
										
										
										
											2019-05-08 21:07:36 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  document.addEventListener('DOMContentLoaded', function(){
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    document.getElementById('sendMessage').onclick = function(){
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 01:01:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-11-25 10:21:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      const userName = document.getElementById('name').value;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const url = 'https://jsonplaceholder.typicode.com/posts';
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								      // Add your code below this line
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 01:01:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								      // Add your code above this line
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    };
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  });
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / script >  
						 
					
						
							
								
									
										
										
										
											2019-11-25 10:21:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								< style >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  body {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    text-align: center;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-family: "Helvetica", sans-serif;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  h1 {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-size: 2em;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-weight: bold;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  .box {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-radius: 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #eee ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    padding: 20px 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  button {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    color: white;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #4791d0 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-radius: 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border: 1px solid #4791d0 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    padding: 5px 10px 8px 10px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  button:hover {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #0F5897 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border: 1px solid #0F5897 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / style >  
						 
					
						
							
								
									
										
										
										
											2019-11-25 10:21:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 01:01:53 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< h1 > Cat Friends< / h1 >  
						 
					
						
							
								
									
										
										
										
											2019-11-15 16:56:28 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< p  class = "message box" >  
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  Reply from Server will be here
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < label  for = "name" > Your name:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    < input  type = "text"  id = "name" / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < / label > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < button  id = "sendMessage" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Send Message
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < / button > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-27 19:02:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# --solutions--
  
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-07-13 18:58:50 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```html
							 
						 
					
						
							
								
									
										
										
										
											2019-11-25 10:21:17 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  document.addEventListener('DOMContentLoaded', function(){
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    document.getElementById('sendMessage').onclick = function(){
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const userName = document.getElementById('name').value;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const url = 'https://jsonplaceholder.typicode.com/posts';
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      // Add your code below this line
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      const xhr = new XMLHttpRequest();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      xhr.open('POST', url, true);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      xhr.onreadystatechange = function () {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if (xhr.readyState === 4 & &  xhr.status === 201){
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          const serverResponse = JSON.parse(xhr.response);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          document.getElementsByClassName('message')[0].textContent = serverResponse.userName + serverResponse.suffix;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     };
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     const body = JSON.stringify({ userName: userName, suffix: ' loves cats!' });
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     xhr.send(body);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      // Add your code above this line
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    };
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  });
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< style >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  body {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    text-align: center;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-family: "Helvetica", sans-serif;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  h1 {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-size: 2em;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    font-weight: bold;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  .box {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-radius: 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #eee ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    padding: 20px 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  button {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    color: white;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #4791d0 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border-radius: 5px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border: 1px solid #4791d0 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    padding: 5px 10px 8px 10px;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  button:hover {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    background-color: #0F5897 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    border: 1px solid #0F5897 ;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / style >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< h1 > Cat Friends< / h1 >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p  class = "message" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Reply from Server will be here
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< p >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < label  for = "name" > Your name:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    < input  type = "text"  id = "name" / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < / label > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < button  id = "sendMessage" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Send Message
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < / button > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / p >  
						 
					
						
							
								
									
										
										
										
											2018-09-30 23:01:58 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```