Jquery Dropdown on change not working

时间:2016-02-22 20:55:10

标签: javascript jquery html

下面的代码应捕获所​​选值并将其添加到div中。我不能为我的生活得到代码来回应。我尝试过不同的选择器和事件听众,但仍然无法工作。非常感谢任何帮助!

$("#mapDataTable select").on("change", function(){
var option = $(this).val();
$("#exBuilder").innerHTML += ' '+option;
});

$("#mapDataColumn select").on("change", function(){
var option = $(this).val();
$("#exBuilder").innerHTML += ' '+option;
});

$("#analyzeFunction").on("change", function(){
var option = $(this).val();
$("#exBuilder").innerHTML += ' '+option;
});

$("#parameterValue select").on("change", function(){
var option = $(this).val();
$("#exBuilder").innerHTML += ' '+option;
});

                                                             映射到DataTable                                 T_                                                      

                    <div id="mapDataColumn" name="mapDataColumn" style="width: calc(25% - 4px)"  class='inlineBlock hundredHeight'>
                        <select id="">
                            <option value="" disabled selected>Map to Data Column</option>
                            <option value="c_">c_</option>
                        </select>                   
                    </div><!--mapDataColumn-->
                    <div id="analyzeFunction" name="analyzeFunction" style="width: calc(25% - 4px)"  class="inlineBlock hundredHeight">
                        <select id="">
                            <option value="" disabled selected>Analyze Function</option>
                            <option value="add">Add +</option>
                            <option value="subtract">Subtract -</option>
                            <option value="multiple">Multiply *</option>
                            <option value="divide">Divide /</option>
                            <option value="greater">Greater ></option>
                            <option value="less">Less <</option>
                            <option value="greatequal">Greater | Equal</option>
                            <option value="lessequal">Less | Equal</option>
                            <option value="equal">Equal =</option>
                            <option value="notequal">Not Equal <></option>
                            <option value="and">And &</option>
                            <option value="or">Or |</option>
                        </select>
                    </div><!--analyzeFunction-->
                    <div id="parameterValue" name="parameterValue" style="width: calc(25% - 4px)"  class="inlineBlock hundredHeight">
                        <select id="">
                            <option value="" disabled selected>Display Parameter Value</option>
                            <option value="amount">Amount</option>
                            <option value="sum">Sum</option>
                            <option value="average">Average</option>
                            <option value="count">Count</option>
                            <option value="percentage">Percentage</option>
                            <option value="min">Minimum</option>
                            <option value="max">Maximum</option>
                            <option value="median">Median</option>
                        </select>
                    </div><!--parameterValue-->

0 个答案:

没有答案