使用Calx jQuery插件制作一个计算表单。

地址:http://www.myjqueryplugins.com/jquery-plugin/calx-jquery-plugin

用法:

表单写法:

<form id="calx">
         A = &lt;input id="A" type="text" value="3" /&gt; 
         B = &lt;input id="B" type="text" value="4" /&gt; 
        (A+B)= &lt;input id="C" type="text" data-     formula="$A+$B" /&gt;
</form>

CSS:

input.writeabl e{
    background:#ffffcc;
}
input.readonly{
    background:#f8f8f8;
}
input.absolute{
    color:red;
}

JS:

$(document).ready(function(){
   $('#calx').calx();
});

效果:

用起来很简单,没什么水平。只要知道有这么个东西就行了。以后用到的时候拿来用。。

原文地址:https://www.cnblogs.com/Akishimo/p/2851859.html