jQuery is very cool library, you can do so many things faster than normal javascript, here is one example: If you have multiple input and all of them have same class, you can sum of their value and more. “each” function does everything. Take a look at codes below.


<script type="text/javascript">
function sum(classname)
    var sum = 0;
          if(!isNaN(this.value) &&  this.value.length!=0)
                sum += parseFloat(this.value);



Sum:<input type="text" />
Value1:<input type="text" />
Value2:<input type="text" />
Value3:<input type="text" />
Value4:<input type="text" />
<input onclick="sum('classname');" type="button" value="Sum" />

[button link=”http://makdeniz.com/source/input_sum/input_sum.zip”window=”yes”]Download Source[/button] [button link=”http://makdeniz.com/source/input_sum/index.htm” window=”yes”]Demo[/button]