Translate html temple to javascript temple