0

このヘッダーコードを持つjquerymobileアプリがあります

@section header
{
@Html.ActionLink("Cancelar", "DocsCancelar", "Docs", new { area = "Documentos" }, new { StrIdDocumento = "", data_icon="delete" })
<h1 id="NombreItem">Ubicacion 50 </h1>
@Html.ActionLink("Grabar", "DocsGuardar", "Docs", new { area = "Documentos",StrIdDocumento = SessionBag.Current.StrIdDocumento }, new { data_icon="check" })
}

のテキストを変更したい

<h1>****</h1> tag. 

私はこのjquery関数を持っています

$(data).find('NombreItem').each(function () {
    $('#NombreItem').replaceWith($(this).text());
})

しかし、これはタグ全体を置き換えます。変更する必要があるのは、Ubicacion 70のUbicacion 50またはそのようなものだけです。

4

2 に答える 2

1

ただ行う:$('#NombreItem').text(newText);

于 2012-11-19T02:18:33.273 に答える
0

Ubicacionのテキストをspanタグで囲み、タグid="replaceText"全体を置き換えてみませんか?

于 2012-11-19T02:19:42.783 に答える