javascript - explain strange jquery selector -



javascript - explain strange jquery selector -

i exercising @ http://jqexercise.droppages.com/#page_0016_ , after completing exercise "change h2 h3" checked out reply pressing "give up?" , saw this:

var target = $('#target'); target.html(target.html().replace(/h2/g,'h3'));

does has clue how .replace(/h2/g,'h3') "selector" works?

i did not find .replace() , maybe deprecated. when found .replacewith() did not find references selector looks reg ex escape character.

if can explain or point read grade full.

actually if right /h2/ regex expression. between // taken , replaced string after comma. g flag apply matching globally.

you can read on mdn

javascript jquery

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -