Remove css class of all textbox inside multilevel div in jquery -
I want to remove the specific CSS class of all text boxes inside the 3rd level div.
& lt; Div class = "panel-panel-default" id = "pnlChangeLoginInfo" & gt; & Lt; div class = "panel-title" & gt; Change login information & lt; / Div & gt; & Lt; Div class = "panel-body" & gt; & Lt; Div class = "row" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-5" & gt; Current password: & lt; / Div & gt; & Lt; Div class = "col-md-7" & gt; & Lt; Input class = "form-control" id = "txtcurpassword" name = "txtcurpassword" type = "password" / & gt; & Lt; Input class = "form-control" id = "hidCurPassword" name = "Contact_Model.Password" type = "hidden" value = "irecadmin01" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-5" & gt; New Password: & lt; / Div & gt; & Lt; Div class = "col-md-7" & gt; Input gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-5" & gt; Repeat password: & lt; / Div & gt; & Lt; Div class = "col-md-7" & gt; Input gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-5" & gt; Login email address: & lt; / Div & gt; & Lt; Div class = "col-md-7" & gt; & Lt; Input class = "form-control" id = "txtLoginEmail" name = "Contact_Model.EmailAddress" type = "text" value = "william.robinson@irec Idaho.gov" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; How can I remove the CSS class "form-control" of all the text boxes based on ID id "pnlChangeLoginInfo" in this html
$ ('# pnlChangeLoginInfo & gt; div & gt; div & gt; input. Format-control'). RemoveClass ('form-control'); Please note that very accurate match input.form-control element exactly 3 Level below the #pnlChangeLoginInfo element However, I do not see any other element matching at other levels that match the input.form-control criteria, so you get the following The work is fine: $ ('# pnlChangeLoginInfo input.form-control'). RemoveClass ('form-control'); The advantage of the other is that it will be more flexible for future small DOM updates.
Comments
Post a Comment