javascript - Change the Image Link to "#" using jQuery -


i validate image path whether image path or other path. if image replace particular href value # # value affected links. how can replace image link #

jquery(document).ready(function($) {    $("a").each(function(i, el) {       var href_value = el.href;       if (/\.(jpg|png|gif)$/.test(href_value)) {          jquery('a').prop('href', '#');       }    }); }); 

here

fiddle

any suggestion great.

use this

jquery(this).prop('href', '#'); 

or

jquery(el).prop('href', '#'); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -