<td onclick="myfunc()"> <div id="word_id">Id</div> Name </td>
function myfunc(){ var mydata = document.getElementById('word_id').innerHTML; alert (mydata); }