[jQuery] jQuery regex replace syntax
Hello.
Does jQuery have a nice way to do a regular expression replace on an
attribute?
I currently have this:
$j(this).attr( 'src' , $j(this).attr('src').replace( /regex/ ,
'text' ) )
But that's messy, I'd prefer this:
$j(this).replaceAttr( 'src' , /regex/ , 'text' )
Is something like that possible?
Thanks,
Peter