javascript - How to use part of the Id or Class of DOM element with jQuery selector? -
how use part of id or class of dom element jquery selector?
i.e. have
id="some_extra_name"
can use "extra" elements jquery?
yes, can do
$elements = $('[id*=extra]');
if wanted elements id starts "extra"
, you'd
$elements = $('[id^=extra]');
and elements id ends "extra"
:
$elements = $('[id$=extra]');
Comments
Post a Comment