I have a div element that dynamically fetches information (rss feeds) based on its id (id="rss-feeds") using the jQuery-rss plugin as shown below
jQuery(function($) {
$("#rss-feeds").rss("http://feeds.feedburner.com/tar-home?format=xml", {
limit: 1,
effect: 'slideFastSynced'
});
});
I am attempting to create the div element through JQuery so that when a button is clicked, a new Div with the id="rss-feeds" is generated and automatically displays the characteristics of the original id along with its contents fetched from the plugin.
The corresponding HTML code looks like this
<button name="tech">Technology</button>
The JavaScript I am using is as follows
$(document).ready(function (){
$("button[name='tech']").click(function(){
var create = ('<div id="rss-feeds"></div>');
$(this).after(create);
});
});
Currently, a new Div gets created but it does not inherit the CSS styles associated with id="rss-feeds" nor does it display the fetched content. It appears invisible, although inspection reveals its presence.
How can I achieve the desired outcome in this scenario?