function modf() { $("#f1 input").val(""); $("#f2 input").val(""); $("#f3 input").val(""); var ss = $("#ss").val(); if (ss == "3") { $("#tianxie").append($("#f1")); $("#tianxie").append($("#f2")); $("#f1 input").removeAttr("readonly"); $("#f2 input").removeAttr("readonly"); $("#tianxie").append($("#f3")); $("#f3 input").attr("readonly", "readonly"); } else if (ss == "2") { $("#tianxie").append($("#f1")); $("#tianxie").append($("#f3")); $("#f1 input").removeAttr("readonly"); $("#f3 input").removeAttr("readonly"); $("#tianxie").append($("#f2")); $("#f2 input").attr("readonly", "readonly"); } else if (ss == "1") { $("#tianxie").append($("#f2")); $("#tianxie").append($("#f3")); $("#f2 input").removeAttr("readonly"); $("#f3 input").removeAttr("readonly"); $("#tianxie").append($("#f1")); $("#f1 input").attr("readonly", "readonly"); } } modf(); function calsi() { var ty = $('#ss').val(); var m = $('#res1').val(); var v = $('#res2').val(); var d = $('#res3').val(); if (ty == 1) m = null; if (ty == 2) v = null; if (ty == 3) d = null; if (m != null && v != null) { d = Math.round((m / v) * 100) / 100; $('#res3').val(d); } else if (v != null && d != null) { m = Math.round((d * v) * 100) / 100; $('#res1').val(m); } else if (m != null && d != null) { v = Math.round((m / d) * 100) / 100; $('#res2').val(v); } return false; }