Hello,
I just started learning what DOM is - though it is ssimilar to HTML it hasthat parent uncle...
And in one of my tests i did something wrong and here it is -
<html>
<body>
<div align="center" id="maindiv">Hello I want fruit for today, OK ?</div>
<button onclick="asd()">Remove The DIV</button>
<script>
var x=document.getElementById("maindiv");
function asd() {
x.parentNode.removeChild(x);
}
</body>
</html>
Please can anyone tell me whats wrong![]()



,
Reply With Quote





Bookmarks