jeudi 15 octobre 2020

if else contains string from output neo4j

there is 2 variable string from output, the output is from Neo4j.The output is : 1 is {txtlistTelepons}; 2 is {txttelpon};

as you can see on this pic

How to bold font in 2 using if else , I want bold font in 2 if the character is contain in 1 . As you can see on this pic 81298855902 is bold, but isn't contain on 1 : 218970427 / 2240024 / 8111162710 / 81367436572 / 628111162710 / 16314642 / 999999991.

my code :

  <section class ="col col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td style="width:10%">PHONE</td>
                    <td>{txtlistTelepons}</td>
                </tr>
                      </tbody>
        </table>
        <div class="alert alert-info fade in">
                </div>
       <table id="tabelEmailTelepon" class="table table-striped table-bordered table-hover margin-top-0">
            <thead>
                <tr>
                    <th><strong>Telepon</strong></th>
                  
                </tr>
            </thead>
            <tbody id="EmailTelepon1">
                <tr class="success">
                    <td class="telepons" >{txttelpon}</td>
                   style type="text/css">
                     .telepons { font-weight: bold; }
                      </style>
                </tr>
                   
            </tbody>
        </table>
    </section>
    <script type="text/javascript">
                   function telepon() {
          let telepon1 = {txtlistTelepons};
          let telepon2 = {txttelpon};
           if ( telepon1.includes(telepon2) {
document.getElementByclassname("telepons").style.fontWeight = "bold";
            }
            else  
              {
document.getElementByclassname("telepons").style.fontWeight = "normal";
            } }
               
    </script>

Aucun commentaire:

Enregistrer un commentaire