update d&d javascript