My question title isn't the best one, but here is the deal:
I have six paragraphs. Three of them contain text, and other three contain links, like this:
<p>Text 1</><p>Link one</>
<p>Text 2</><p>Link two</>
<p>Text 3</><p>Link three</>
Every link calls a jQuery function which should create an HTML input element instead of text in corresponding paragraph (eg: clicking Link three should create text input element in paragraph which contains Text 3).
On second click, the same link should create an AJAX call with some parameters, which my Django view will pick up, and act accordingly.
Currently, I have this:
$('.column a').click(function ()
{
oldValue = $('#email').text()
$('#email').html('<input type="text" value="'+oldValue+'"/>')
$('a#changeMail').removeClass('button').addClass('success button')
});
and it works for one paragraph pair. How can I make it work for any "paragraph pair"? Thank you in advance.