Jess McKenzie Jess McKenzie - 11 months ago 41
Javascript Question

Percentage of values changed in a textarea


is a textarea

is also a textarea but this is were I will be making the changes

How could I calculate a percentage of the values changed in B starting at 0%?


var changed, original = $(".originalData").val() $(".changedData").change(function(){ changed = $(this).val(); });


if you want to calculate the percent of changes i guess you have to do something like this

var changedData = $('.changedData').val().length;
var originalData = $('.changedData').val().length;

var precentageOfChange = changedData/originalData * 100 - 100