Reputation: 109
In PHP we can declare variables in the beginning of the document this way:
<?php
$title="Title of the webpage";
?>
In the html code this title will replace the echo $title
in the html code of the webpage.
Is it possible to do it using html and Javascript, I mean without using PHP?
Upvotes: 2
Views: 10399
Reputation: 1897
<script>
var someVariable="someValue";
document.title = someVariable;
</script>
Upvotes: 4