Changed function template for setValue into more jquery-like