How to change the text of h3 from asp.net, I do it in the manner of the description but it does not work for me?

0

The code is the following codebehind as well as the designer, the idea is to change the text of the h3 when changing the radiobutton selection, but it does not execute the jquery code the text remains in Add New Product / Service and does not change a Disassociate Product / Service

protected void rdasounoauno_CheckedChanged(object sender, EventArgs e)
{
 string script = "cambiatexto();";
 ScriptManager.RegisterStartupScript(this, typeof(Page), "F1", script, true);

}

<div class="panel panel-primary">
                            <div class="panel-heading" >
                                <h3 class="panel-title" id="panelconteasocia">
                                    Agregar Nuevo Producto/Servicio
                                </h3>
                            </div>
 </div>

<script language="javascript" type="text/javascript">
 function cambiatexto() {

             $("#panelconteasocia").text = "Desasociar Producto/Servicio";       
}
</script>
    
asked by lucho 23.04.2018 в 19:36
source

1 answer

0

Your problem is here:

$("#panelconteasocia").text = "Desasociar Producto/Servicio";

In jQuery, the text is changed like this:

$("#panelconteasocia").text("Desasociar Producto/Servicio");
    
answered by 23.04.2018 / 19:41
source