Player 1:
0
Player 2:
0
Code270048 is platform which provide knowledge based on Information & Technology. Enhance your coding skills with Code270048.
What is IP Address?
-> An Internet Protocol address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.
<!DOCTYPE html>
<html>
<head>
<title>Getting Clients IP</title>
<style>
*{margin:0;}
html, body{width:100%; height:100%;}
p, h1 { color: green;}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
<script>
/* Add "https://api.ipify.org?format=json" statement
this will communicate with the ipify servers in order to retrieve the IP address $.getJSON will
load JSON-encoded data from the server using a
GET HTTP request */
$.getJSON("https://api.ipify.org?format=json", function(data) {
// Setting text of element P with id gfg
$("#gfg").html(data.ip);
})
</script>
</head>
<body align="center">
<h1>Your IP Address is:</h1>
<p id="gfg"></p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Form in html5</title>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<style>
body {
text-align:center; }
*{outline:none;}
#dform{
background-color:rgb(10,88,99); }
#box{
width:device-width;
height:50px;
background-color:rgb(24,78,90);}
p{
color:rgb(255,205,25);
font-size:300%;
font-style:italic;
background-color : rgb(24,78,90);}
#submit{ border-radius : 5px;}
</style>
</head>
<body bgcolor=black text=white>
<h1>Fill The Form</h1>
<hr width=70% height=2px color=red>
<div id=dform>
<br>
<form name=myform>
Name:<input name=formname type=text value="" required placeholder="enter your name">
<br><br>
E-mail:<input type=email name=email placeholder="xyz123@gmail.com">
<br><br>
Date of Inception:<input type=date name=bday>
<br><br>
Office time:<input type=time name="usr_time">
<br><br>
Number of years completed(between 1 and 100):<input type=number min=1 max=100>
<br><br>
Office phone number:<input type=tel name=phone pattern="[0-9]{2}[0-9]{10}" required>
<br><br>
Add your homepage:<input type=url name=homepage>
<br><br>
<input type=button value="Click here to Submit" id=submit onClick=c()>
</form><br>
</div>
<div id=box >
<p>Thank you</p>
</div>
</body>
</html>
Output :