How to remove the name of a parent div a class with C # Razor?

75
May 16, 2018, at 4:00 PM

In jQuery you can get the parent element of a div element and remove the class, something similar to this:

var father = $("#id_div").parents('li');
var id_fatherDIV = padre.attr('id');
$("#" +id_fatherDIV).removeClass("estilo_div")

In the view I have these elements:

<li id="li_father" runat="server" class="estilo_div">
    <a id="id_div" runat="server" href="#" >
        <i class="fa fa-fw fa-exchange"></i>
        Solicitud
    </a>
</li>

In C #, I need to get the id = li_padre

But when working on MVC and Razor, what would the jQuery example look like in a View using Razor?

The goal is to get to the element li_father, from the element id_div using C #, and remove the class estilo_div from this same parent element

READ ALSO
Asp.net Core - where are these CSS/LESS files coming from?

Asp.net Core - where are these CSS/LESS files coming from?

I created a default Aspnet Core web app and ran it

60
Ngx-bootstrap popover positioning auto not working as expected on right side of screen?

Ngx-bootstrap popover positioning auto not working as expected on right side of screen?

I'm trying to implement some popovers on our application (Using Angular 60

82
Examine/toggle CSS pseudo-classes in browser developer tools

Examine/toggle CSS pseudo-classes in browser developer tools

We have a few dozen CSS pseudo-classesMost browsers' developer tools allow us to examine/toggle only a handful of them like :hover, :focus, :active

58
Customize boostrap-vue in a Nuxt project

Customize boostrap-vue in a Nuxt project

I have a nuxt project where I use bootstrap-vue as a module to style my components

55