- JS
- <script>
- var selectId = document.getElementById("VariantType");// 获取 ID
- selectId.onchange = function ()
- {
- var result = selectId.options[selectId.selectedIndex].innerhtml;// 获取选中文本
- if (result == "Fusion") { // 当变异类型的值为 Fusion 时, 变异值为空
- $("#Variant").val("");
- }
- }
- </script>
- jQuery
- $("#VariantType").change(function () {
- var result = $(this).children('option:selected').val();
- if (result == "Fusion") {
- $("#Variant").val("")
- }
- });
来源: http://www.bubuko.com/infodetail-3016673.html