Can jQuery or JavaScript be used with a regex to select multiple elements with similar id?
I have the following paragraphs:
<p id="item5_2"> A </p>
<p id="item9_5"> B </p>
<p id="item14_2"> C </p>
I want to change the content of paragraphs with id starting in item
and ending in 2
.
I used the following jQuery:
$("#item[d]*2").html("D");
but it doesn't work. How can I get it to work?
JSFiddle Demo
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…