- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomreplacement.php
More file actions
Latest commit
58 lines (55 loc) · 1.02 KB
/
Copy pathDomreplacement.php
File metadata and controls
58 lines (55 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!doctype html>
<htmllang="en">
<head>
<metacharset="utf-8">
<title>
DOMremoval
</title>
<scriptsrc="https://code.jquery.com/jquery-1.10.2.js">
</script>
<style>
div{
color: pink;
background:black;
font-size:20px;
margin:20px;
padding:10px;
}
span{
border: 3pxsolidgrey;
width:50px;
background:blue;
}
.inner{
font-style:oblique;
}
.wrapclass{
border:3pxsolidgreen;
}
</style>
</head>
<body>
<divclass="outer">
<divclass="inner">Innerdiv1</div>
<divclass="inner"style="border:2pxsolidgreen">Innerdiv2</div>
<divclass="inner">Innerdiv3</div>
</div>
<inputtype="button"name="click"value="click">
<button>Clear</button>
<inputtype="text"name="fullname" >
<script>
//REPLACEALL
//$(".inner").eq(1).replaceWith("<h2>A new Heading<h2>");
/*$(".inner").click(function(){
$(this).replaceWith("<button>"+$(this).text()+"</button>");
});*/
/*$(".inner").click(function(){
$(this).replaceWith($("input:text"));
});*/
//REPLACEALL
$(".inner").click(function(){
$("input:button").replaceAll($(this));
});
</script>
</body>
</html>