javascript - Change part of a string with jQuery -


i'm sure simple, can't figure out.

i have html:

<img src="/7290/9200572193_f95fb66c50_m.jpg" />

which need change

<img src="/7290/9200572193_f95fb66c50_b.jpg" />

this isn't same image, _m.jpg , _b.jpg are. how can jquery?

you can do:

var imgsrc = "/7290/9200572193_f95fb66c50_m.jpg"; imgsrc = imgsrc.replace("_m.jpg", "_b.jpg"); 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -