<!DOCTYPE html>
<html>
<head>
<style>
#demo{
background-color : blue;
width :100%;
height : 400px;
}
</style>
[removed]
function myFunction() {
document.getElementById('demo').style.cssText = 'width : 80%; position : absolute';
var desc = document.createElement("div");
document.getElementById('box').appendChild(desc);
desc.id = 'description';
document.getElementById('description').style.cssText = 'width : 20%; background-color : red; height : 400px;float : right;'
}
[removed]
</head>
<body>
This is a paragraph.
<button type="button" onclick="myFunction()">Display Date</button>
</body>
</html>
댓글 0