I want to send the data from one paragraph located in one section of a page to another section after an element is clicked.
This is strictly esthetics and doesn't have to do with functionality.
Here are the html elements.
I've truncated them for easy readability. If you need the entire block, I'll post it.
echo '<p class="desc_link">';
echo '<a class="desc_show more" rel="' . $image_title . '" href="#desc">Description</a></p>';
echo '<p class="attach_desc">'.$description;
echo '</p></li>';
If the second line above is clicked, I'd like the third line to be passed to a div with an id of ajax on the same page.
I am using this code to try and accomplish this but it isn't working.
$("a.desc_show").click(function() {
var show_desc = $('p.attach_desc').html();
$('#ajax').html(show_desc);
return false;
});
});
Here is another block of jQuery that I'm using on the same page. The block of html above is located on another page that is loaded by this block. This may be a factor in causing my other block not to work.
$(document).ready(function(){
$.ajaxSetup({cache:false});
$("a.btn").click(function(){
var import_link = $(this).attr("href");
$("#portfolio").html("loading...");
$("#portfolio").load(import_link);
return false;
});
Thanks in advance for any suggestions on how to accomplish this. If my code is improper, I would not be surprised as I am a novice at jQuery.

New Topic/Question
Reply



MultiQuote




|