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

193
Views
jinja2 javascript block fadeout not working

I believe this code should be working but it does not appear to be

{% extends "layout.html" %}
{% block javascript %}
    <script type="text/javascript" charset="utf-8">
    $('#email').change(function () {
      var len = $('#email').val().length;
      if (len > 0) {
          $("#user_accounts").fadeOut(1)
      } else {
          $("#user_accounts").fadeIn(1)

      }
  });
    </script>
{% endblock %}
{% block body %}
<!-- About Section -->
    <section id="about"  class="bg-light-gray">
        <div class="container">

I am trying to hide a div #user_accounts if an text input field contains any text. There are no error messages when debugging and user_accounts is not fading.

here is the html i'm using

                        <br>
                        Add user to accounts: <input id='email' type="text" placeholder="user@email.com">
                        <br><br>
                        <div id="user_accounts">
                        {% for item in accounts %}
                            <div class="col-md-4">
                                <div class="pull-left"><input type="checkbox" name="accounts" id="accounts" value="{{ item[0] }}" {% if item[0] not in muted %}checked{% endif %}>
                                    {{ item[0] }} - <span title="{{item[1]}}">{{item[1] | truncate(20, True) }}</span>
                                </div>
                            </div>
                        {% endfor %}
                        </div>

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!