Skip to content

Commit 5a9e266

Browse files
authoredJan 25, 2022
Merge pull request Dezenix#89 from geetika005/main
Create button_to_email_field
2 parents 9528c3b + accaa34 commit 5a9e266

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.emailbutton {
2+
background-color: rgb(130 231 255);
3+
}
4+
5+
#emailsub {
6+
background-color: white;
7+
color: rgb(30, 196, 238);
8+
padding: 15px;
9+
border: none;
10+
border-radius: 50px;
11+
cursor: pointer;
12+
width: 100%;
13+
transition: 1s;
14+
}
15+
16+
#input {
17+
margin: 0px;
18+
padding: 10px;
19+
width: 100%;
20+
outline: none;
21+
height: 30px;
22+
border-radius: 50px;
23+
color: black;
24+
border: none;
25+
background-color: white;
26+
}
27+
28+
#send {
29+
position: absolute;
30+
border-radius: 18px;
31+
right: -15px;
32+
z-index: 2;
33+
top: 5px;
34+
border: none;
35+
width: 32%;
36+
padding: 12px;
37+
border: none;
38+
cursor: pointer;
39+
color: white;
40+
background-color: skyblue;
41+
box-shadow: -6px 5px 11px white inset;
42+
transform: translateX(2px);
43+
}
44+
45+
#button {
46+
position: absolute;
47+
top: 5px;
48+
border-radius: 5px;
49+
z-index: 2;
50+
border: none;
51+
cursor: pointer;
52+
color: white;
53+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Document</title>
9+
<link rel="stylesheet" href="button_to_email_field.css">
10+
</head>
11+
<body class="emailbutton">
12+
<div id="button">
13+
<button id="emailsub" onclick="sub()"><strong>Notify Me</strong></button></div>
14+
<script src="button_to_email_field.js"></script>
15+
</body>
16+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function sub() {
2+
var input = document.createElement("input");
3+
var button = document.getElementById("emailsub");
4+
input.setAttribute("type", "email");
5+
input.setAttribute("id", "input");
6+
input.setAttribute("placeholder", "Email");
7+
var send = document.createElement("button");
8+
send.setAttribute("id", "send");
9+
send.innerHTML = "send";
10+
// document.getElementById("sub ").innerHTML = " ";
11+
document.getElementById("button").replaceChild(input, button);
12+
document.getElementById("button").appendChild(send);
13+
}

0 commit comments

Comments
 (0)
Please sign in to comment.