I want to change the content of h1 by using if statement in Javascript, is there a way to make Javascript variable read the content of h1?
<body>
<h1 id="tae">bebe</h1>
<script>
var baby = document.getElementById('tae');
if (baby == 'bebe') {
document.getElementById('tae').innerHTML = 'my moon';
}
</script>
</body>