I want to check if innerHtml have X or O , so i can not add again any thing else , but it\'s not working . it stop after adding the check code , I\'m trying here to do a simple
You don't have to check both if the text is equal to x or not equal to o, one makes the other superflous.
When you set the text of an element using jQUery you supply the value in the call to text, you don't assign it to the return value of the function.
I assume that you want to use the c parameter when you check the value also.
function tdElm(c) {
if ($('#td' + c).text() == "o") {
$('#td' + c).text("x");
}
}