<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div id="test">
<h1>Gaurav Soni</h1>
<p>BCA 1st year</p>
</div>
<script>
var target = document.getElementById("test");
var find = target.hasAttribute("class");
console.log(find);
var find = target.hasChildNodes();
console.log(find);
</script>
</body>
</html>
OUTPUT
Comments
Post a Comment