I am trying to select a clicked “a class mail” href value in order to filter it and add a one word string after the text “…subject=[Site]…” to be like this: “…subject=[Site] string…”
envie um e-mail para sites@atipico.com.br
This is as far as I can go:
$('a.mail').click(function(event){
$(this).prop('href',$(this).prop('href').replace('[Curso]', '[Curso] some text'));
});
I replaced prop by attr but it did not work…
$('a.mail').click(function(event){
$(this).attr('href',$(this).attr('href').replace('[Curso]', '[Curso] some text'));
});
First, I would like to invite you to write code as readable as you can. Here’s how I would do what you’re trying to achieve: