I got a HTML table, that consists of:
<td contenteditable="true">
And I have some function:
f()
{
alert("pew");
}
What should I do to call the function, when I click on my "td"?
OnClick="f();"
doesn't seems to be working.
I got a HTML table, that consists of:
<td contenteditable="true">
And I have some function:
f()
{
alert("pew");
}
What should I do to call the function, when I click on my "td"?
OnClick="f();"
doesn't seems to be working.
You can try below link its has the same question. contenteditable change events
Hope it helps.
You can try something like this:
function f()
{
console.log("pew");
}
document.getElementById("mytd").addEventListener("click", function() {
f()
}, false);
<table>
<tr>
<td contenteditable="true" id="mytd">Content</td>
</tr>
</table>