How to refresh a span or div

simple question but i cant find an answer for this… how can i refresh a content of a div or span?

thanks for the help!

more detail.

<div id = “mydiv”>
some content here

<a href=“javascript:void(0)” onclick=“refreshdiv()”>click me</a>

i wanna refresh the content of “mydiv”

There is a javascript forum for javascript questions.

function refreshdiv() {
    document.getElementById('mydiv').innerHTML = '';

Refresh it with what? Content from a database? An image?

More details, please.

using e.g. jquery

<div id="mydiv"></div>
<a id="refresh">click</a>

$(function() {
  $("#refresh").click(function() {