new javascript code and need to pass dynamic value