I have some JavaScript code, and if the homepage or index (e.g. at malaspulang.com) the tag <h1>
does not change. But if I change the page (e.g. at malaspulang.com/lifestyle), the tag <h1>
will be replaced with <h2>
.
This my code:
<div id="header" class="hide"><h1>this my title</h1></div>
<script>
if(window.URL === 'malaspulang.com'){
}else{
$('#header').empty();
$('#header').html('<h2>this my title</h2>');
}
</script>
In my homepage site, the tag <h1>
should replace with <h2>
I think that my code is true, but I am so confused with this code. So if anyone can help me, I will be happy :)
NB: If anyone that's code with PHP, you can tell me :)