I want to add text to an existing div, when I click the Button with the id #add. But this is not working.
Here my code:
Running example:
//If you want add the element before the actual content, use before()
$(function () {
$('#AddBefore').click(function () {
$('#Content').before('Text before the button
');
});
});
//If you want add the element after the actual content, use after()
$(function () {
$('#AddAfter').click(function () {
$('#Content').after('Text after the button
');
});
});