Functions to rebuild JavaScript's dom selectors