Assuming I need a public web page that displays the email information from a user of my site. In addition to obfuscation, would javascript like this be helpful?
setTimeout(function(){
document.getElementById(id).innerHTML = "<span>" + username + "@" + hostname + "</span>";
},50)
It entirely depends on the spambot. This could stop some spambots, but it wouldn't stop a scraper designed specifically to work around this defense.
That's how arms races work.
It would be pretty straightforward to build a bot that works around this defense you have in mind. You could use a headless browser (such as PhantomJS) to fetch the page, evaluate all the JavaScript on the page, wait an arbitrary amount of time (say, 10 seconds), and then scrape the DOM for email addresses.