I'm making an API called Server.js Now, what I'm trying to do is change the HTML text ({date})
turn to the actual date. Instead of changing it to the actual date it stayed as ({date})
. I'm wondering how I can fix this. Can you help me? This is my code:
var doc = document.toString();
var doc1 = doc.replace("\(\{date\}\)", new Date());
doc.innerHTML = "";
doc.innerHTML = doc1;
Any help appreciated!