JSFiddle - React, Tailwind, and code Playground
by TheDiamondDoge
HTML
<table>
<tr>
<td>
Hehhehe
</td>
<td id="data_transform">
<a href='somehref'>80%</a>
</td>
</tr>
</table>
<button>
Click
</button>
JavaScript
$("td#data_transform").each(function() {
var link = $(this).find('a').attr('href');
var percentage = $("td a").html().slice(0, -1);
$(this).html('');
$("<input>").attr({
readonly: true,
name: 'value',
size: 3,
kpinametype: "7.1"
}).val(percentage).addClass('input_view_mode').css('display', 'inline-block').appendTo($(this));
$("<input>").attr({
readonly: true,
name: 'value',
kpinametype: "7.1"
}).val(link).addClass('input_view_mode').css({
'display': 'inline-block',
'width': '90px'
}).appendTo($(this));
});
$("button").on('click', function(){
//alert($("td#data_transform").parent().html());
alert($("table").find('a'));
});