Here I am a using regular expression to remove the html input tag. But I have to replace with its value.
I need to remove the input tag without the value. Result should be
<td> 15200 </td>
on td tag.
function fnTextValue() {
var tab_text = "<td><input name='MyTextBox' type='text' value='15200' id='MyTextBoxId'></td>";
console.log(tab_text);
tab_text = tab_text.replace(/<input[^>]*>|<\/input>/gi, "");
console.log(tab_text);
}
<button id="btnExport" onclick="fnTextValue();">
Text Value
</button>