JSFiddle - React, Tailwind, and code Playground
JavaScript
var data = "<table width='100%'><tr><td class='messageclass'><strong>Sam</strong>hi<td><td style='color:Gray;' width='85px'><small>20120507<small></td></table><input type='hidden' id='hiddenid' value='4,5,6,7'>";
var hidden_value = data.match(/<input type='hidden' id='hiddenid' value='(.*)'/);
alert(hidden_value[1]);