Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8301499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:58:32+00:00 2026-06-08T16:58:32+00:00

Actually the question is in the subj… Is it possible to make handlebars template

  • 0

Actually the question is in the subj…
Is it possible to make handlebars template framework, to recognize templates within a div tag and not in script tag?

For example I would like to create template with this markup:

<style>
    div.text-x-handlebars {display:none;}
</style>
<div class="text-x-handlebars-template">
    <h2>I'm template</h2>
    <p>{{welcomeMessage}}</p>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:58:33+00:00Added an answer on June 8, 2026 at 4:58 pm

    Yes you can put your templates in <div>s rather than <script>s, for example:

    http://jsfiddle.net/ambiguous/RucqP/

    However, doing so is fraught with danger. If you put your template inside a <div> then the browser will interpret it as HTML before you’ve filled it in; so, if your template’s HTML isn’t valid until after it has been filled in, the browser may attempt to correct it and make a mess of things. Also, if you have id attributes in your templates, then you will end up with duplicate ids (one in the template <div> and a repeat in the filled in template that you put in the DOM) and that will cause all sorts of strange and interesting bugs. The browser will also try to download any images inside the templates in a <div>, this may or may not be a problem (if might even be desirable but probably not desirable if the image uses a template variable in its src attribute).

    Basically, you can do it but you shouldn’t, you should put your templates in <script id="..." type="text/x-handlebars-template"> elements instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually my question here is: are null and nil equivalent or not? I have
pretty straightforward question actually.. is it possible in PHP to combine two separate arrays
I'm not sure how to ask this question actually... REF: http://qif.codeplex.com/ This API takes
Actually the question is in the title. Anyway I would like to repeat it:
My question actually consists of multiple questions. I'm frequently reading about companies who deploy
The question actually in it. Google Calendar provides a convenient API for access to
The Question actually says it all. The reason behind this question is I am
Problem This question actually came up at work today. We are planning an experiment
There are actually 2 question i want to cover in this topic. 1) Is
So, this is actually this question is my current keystone. I'm working on refactoring

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.