Ported elements to javascript.