Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
displaying a date in django template using javascript

I'm not sure why the date won't display in this django template, using javascript and html: I've also found this helpful: how to display a javascript var in html body

But following that, still can't get it to work. Currently I have:

{% extends 'chattr.html' %}

<section class="">
    hello
</section>
    <script>
        let d = new Date();

        document.getElementById("date0").innerHTML = d;
        n =  new Date();
        y = n.getFullYear();
        m = n.getMonth() + 1;
        d = n.getDate();
        document.getElementById("date").innerHTML = m + "/" + d + "/" + y;
    </script>
<p id="date"></p>
{% block chatStream %}
<b>smallest_steps:</b> <br> 
Hello! Please send me a message:)   <span id="date0"></span>  <br>
<p id="date"></p>
{% endblock %}

and chattr.html

<h1>ss</h1>
{% block title %}{% endblock %}
{% block chatStream %} {% endblock %}

Thanks so much

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!