私のページには、次のようなタグがいくつかあります。
<parameter name="address" class="transform">@ViewBag.Address</parameter>
そのために、私はこの関数を作成しました:
function transform(id) {
$('#' + id + ' .transform').each(function (index) {
var tag = $(this).parent().html();
$(this).parent().html() = tag.replace('parameter','input type="text"');
});
}
$(this).parent().html() をアラートすると、元のタグが取得されますが、関数は機能しません。私は何を間違っていますか?