如何使用Jquery仅删除selectedchildren类?
with stg as
(
select '(ofof+ol)' str from dual union all
select '(oof+ol+of)' from dual union all
select '(*of + 2)' from dual union all
select '(of*of + 2)' from dual
),
rec ( str, lvl, new_str ) as
(
select str, 1, upper(str)
from stg
union all
select str, lvl + 1,
regexp_replace(new_str, '(\W|^)(OF)(\W|$)', '\1"OF"\3', 1, lvl)
from rec
where regexp_instr(new_str, '(\W|^)(OF)(\W|$)', 1, lvl) > 0
)
select str, new_str
from rec
where regexp_instr(new_str, '(\W|^)(OF)(\W|$)', 1, lvl) = 0
;
STR NEW_STR
------------ ------------------
(ofof+ol) (OFOF+OL)
(oof+ol+of) (OOF+OL+"OF")
(*of + 2) (*"OF" + 2)
(of*of + 2) ("OF"*"OF" + 2)
答案 0 :(得分:1)
如果您只想关注class="parent"
<div>
:
.eq()
是子选择器;和
.removeClass()
从该元素中删除所需的类
$('.parent').eq(1).removeClass('selectedchildren');
答案 1 :(得分:0)
$('.selectedchildren').removeClass('selectedchildren');
这将从所有选定的孩子中删除该课程&#39;元素。如果您需要确保它只是第一个,那么您可以
$($('.selectedchildren')[0]).removeClass('selectedchildren');