Populating a "p" tag in HTML with Jquery
html, javascript, jquery
Solution
This will fill the paragraph tag inside `#pop-up` with the text inside the `Comments` variable
$("#pop-up > p").text(Comments);
I suggest you have a read of the API here.
Problem
I cant figure out the syntax for this iv browsed the net when i mention "P" it returns multiple searches regarding PHP What i want to do is populate a p tag text with a variable value? This is my Jquery ``` $('.FOS, .MF, .CW, .OO, .LL, .CO, .TAK, .FCS, .CO').mouseover(function(e) { var tr = $(this).closest('tr'); var Comments = tr.find('.GeneralComments').text(); if (Comments != "") { $('div#pop-up').show(); $('p').text == Comments; } else { $('div#pop-up').hide(); } return false; }); ``` Im trying to assign the value from Comments to the p.text but its not working? Heres my div where the p take is situated. ``` <div id="pop-up"> <h3> Over all Notes</h3> <p> This is where i want the value from comments to appear? </p> </div> ``` Any help would be appreciated, thank you.