So here's the code:
window.onload=function(e){
//Created by Firestar001
var X;
var Y;
var board="";
var rizzalt=document.getElementById("rezzalt");
var letters = new Array;
letters = ["A","B","C","D","E","F","G","H","I","J"];
for(a=0; a<=9; a++){
board+="<tr>";
for(b=1;b<=14; b++)
{
board+="<td id=/'"+ letters[a] + b +"/' onClick=/'AreaCode()/'>" + letters[a]+b+"</td>";
}
board+="</tr>";
}
var Grade = document.getElementById('friend_water');
Grade.innerHTML = board;
}
function AreaCode(){
console.log("I work");
rizzalt.innerHTML+="Works ";
}
<table id="friend_water" border="1 solid black">jklol</table><p></p><p id="rezzalt"></p>
I've included the "rizzalt rezzalt" in there to provide a confirmation while using the code snippit thing on stackoverflow.
So it'll create a battleship grid, A-J, 1-14. What I want to happen is when a player clicks on a square (ex: C4), I want the console to say "I work" so.... I know it works. The table loads properly but when I click on a cell it gives me: Uncaught SyntaxError: Unexpected token ILLEGAL
Referencing to line 1 in the html which is the <!DOCTYPE html> line.
Thank you all for your help.
EDIT: SOLVED.
Thank you again all for your help. The code properly works and now I can get to work on more of my Battleship game.