Can someone please explain statement - $("select", $tbApplications).val("-").on("change", function ?

Discussion in 'jQuery' started by asifakhtar, Jan 18, 2023.

  1. #1
    Is the code only looking for all dropdowns under $tbApplications or is it is looking for dropdowns outside and inside of $tbApplications?
    <table style="border-collapse:collapse; width:100%" id="tblApplications">
    <tbody id="tbApplications">
    <tr id="trApplication_10147658" data-applicationid="10147658">
    <td class="tcenter" data-applicationid="10147658" data-reviewerid="87848165" data-placement="bottom" data-toggle="popover" data-content="<strong>Name:</strong> Hachem, Ramsey<br><strong>Institution:</strong> Washington University<br><strong>Title:</strong> Isolation of Pseudomonas aeruginosa from Respiratory Specimens after Lung Transplantation and the Development of Chronic Lung Allograft Dysfunction" data-original-title="" title="" style="width: 50px; box-sizing: border-box;">
    <select class="form-control form-control-sm" id="optRole_87848165_10147658" data-originalrole="18430" data-oprid="2013738" data-applicationid="10147658" data-reviewerid="87848165">
    <option value="-">-</option>
    <option value="18417">B</option>
    <option value="18414">1</option>
    </select>
    </td>
    </tr>
    <tr id="trApplication_10147470" data-applicationid="10147470">
    <td class="tcenter" data-applicationid="10147470" data-reviewerid="87848165" data-placement="bottom" data-toggle="popover" data-content="<strong>Name:</strong> Morrell, Eric<br><strong>Institution:</strong> University of Washington<br><strong>Title:</strong> Identifying Lung and Plasma Molecular Determinants for CLAD after Respiratory Viral Infection" data-original-title="" title="" style="box-sizing: border-box;">
    <select class="form-control form-control-sm" id="optRole_87848165_10147470" data-originalrole="18432" data-oprid="2070118" data-applicationid="10147470" data-reviewerid="87848165">
    <option value="-">-</option>
    <option value="18417">B</option>
    <option value="18414">1</option>
    </select>
    </td>
    </tr>
    </tbody>
    </table>

    $tbApplications = $("#tbApplications");
    $("select", $tbApplications).val("-").on("change", function () {.....});
     
    asifakhtar, Jan 18, 2023 IP