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

139
Views
How can I replicate **bold** in my django template?

I am trying to replicate how stack overflow allows the user to type text and produces it below at the same time. The code below in the Django Template works for this.

{% block head %}
<script>
function LiveTextUpdate() {
  var x = document.getElementById("myInput").value;
  document.getElementById("test").innerHTML = x;
}

</script>
{% endblock %}

{% block body %}

<div class = typing_container>
    <div class = note_text>
        {{ note_form.note }}
    </div>
</div>

<div class = output_container>
    <div class = output_note_text>
        <p id="test" ></p>
    </div>
</div>

The following is in the forms.py file:

class NoteForm(ModelForm):
    class Meta:
        model = NoteModel
        fields = [
            'note'
            ]
        widgets = {
            'note' : Textarea(attrs={'placeholder' : 'Start a new note', 'class' : 'updated_task_commentary', 'id' : 'myInput', 'oninput' : 'LiveTextUpdate()' }),
        }

How can I replicate the ability to bold text when the text is surrounded by "**" please?

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!