i wanted to get the value of a hidden div in jquery i.e.
<div id="text">hello i am the value, you want</div>
and i want insert this value into a another div in jquery i.e.
$('#bio').html($value);
EDIT:
i forgot to mention that it had to be the text within the block div sorry i.e. its parent
<div class="block" id="status_13">
<div id="text">.......</div>
</div>
i.e.
$('.block').click(function(){
$('#bio').html($('$text').html());
If your
#textelement contains HTML you might want to do:If you are only concerned with the literal text of
#textthen you can do:Of course, if you want to store the text in a variable first, you can do so:
In regard to your later edit:
Notice that I assumed the child
divis marked with a class and not an id. Based on your description, it sounds like you have multiple “block” elements which each contain a “text” element. If that is the case, then$('#text')will always return the first “text” element in the document; IDs are unique in the document.