Could I use jQuery for this, and what could it look like:
Inside a calendar, marked up with a <table>, <td> etc, there’s content for each date, both text and an image.
Above the whole calendar I would like a <div> that would re-display the content of the <td> for the current day.
I’m thinking there would be a way I could retrieve content, such as already written text and images through jQuery (I’m a rookie) and then re-display it somewhere else. For example in a div above a calendar.
Does anybody know how this could be done? Or would I have to use PHP?
UPDATE to question:
this is the code in-between the <head></head>. But it doesn’t work.
<script>
var content = $('.current-day .details').html();
$(document).ready(function(){
$('#nextHappening').html(content);
});
</script>
You have to put
var content = $('.current-day .details').html();inside thedocument.ready()functionIf you want to do it dinamically, like on click of something create a function like
and call on events.
This can help