Use .innerHTML
or .textContent
in javascript of the div email
The innerHTML property sets or returns the HTML content (inner HTML)
of an element.
var emailId = document.getElementById('email').innerHTML;
document.write('<img src="' + get_gravatar(emailId, 150) + '" />');
or
textContent returns null if the element is a document, a document
type, or a notation. To grab all of the text and CDATA data for the
whole document, one could use document.documentElement.textContent.
var emailId = document.getElementById('email').textContent;
document.write('<img src="' + get_gravatar(emailId, 150) + '" />');