Sinevik,
или замени e на event.
function ShowMe() {
*!*
var c = e.target;
*/!*
var f = c.textContent;
console.log(f);
}
var a = [1, 2, 3, 4, 5, 6 ,7, 8];
for(var i = 0; i <= a.length; i++){
var b = document.createElement('p');
b.textContent = a[i];
b.onclick = ShowMe;
window.document.body.appendChild(b);
}