Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  4] [ 5]  / answers: 1 / hits: 48555  / 12 Years ago, tue, march 20, 2012, 12:00:00

Would someone be able to help here?



I would like to fill a div e.g.



<div id=contenthere></div>


with content from an external file e.g.



/includes/about-info.html


when a button with a certain class is clicked e.g.



<p class=classloader>Click Here</p>


Does anyone have a quick code example they can show me to achieve this?


More From » jquery

 Answers
5

Use jQuery.click and jQuery.load:



$(document).ready(function(){
$('.classloader.').click(function(){
$('#contenthere').load('/includes/about-info.html');
});
})

[#86724] Monday, March 19, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anjelicadixied

Total Points: 742
Total Questions: 94
Total Answers: 97

Location: Iraq
Member since Fri, Jun 5, 2020
4 Years ago
;