Jack Fraser Jack Fraser - 4 months ago 5x
Node.js Question

How can I change the html title of my main.hbs file from a partial.hbs?

I am trying to change my html title depending on the partial that I load for the body.

Parent html:

<!DOCTYPE html>
<html lang="en">

Partial body.hbs file:

<h1 id="brick-mason">Brick Mason</h1>
<h3 id="what-is-a-brick-mason-">What is a brick mason?</h3>
<p>Brick masons use various stones, concrete and bricks to build walls, walkways, fences, and other structures.</p>

What can I change so that my partial can determine what the
on my main html page displays?


you can do it easily with JavaScript,

just add in the body.hbs :

<script> document.title = 'the title here ' </script>