I am trying to do data validation on an editable field using an onchange
event trigger. When the event fires, I am passing the event. My function tries to display the innerHTML
in an alert but it always returns null.
Here is my code:
<head>
<script>
function chkchg(evt) {
alert(evt.innerHTML);
}
</script>
</head>
<body>
<table>
<tr>
<td><input class='patched' contenteditable='true' type='text' onchange='chkchg(event.target);' value='Yes'></td>
<td><input class='excluded' contenteditable='true' type='text' onchange='chkchg(event.target);' value='No'></td>
</tr>
</table>
</body>
It seems pretty simple but I don't know what is wrong.