save $("#value") reference, declare it in the outer function scope and re-use the reference