-1

I want to reload the content of one Tab by clicking a button.

Here is the re-design of my problem in Fiddle: http://jsfiddle.net/NhTzt/

I don't know how to do that.

function clear(){
 $("tabs-1").empty(); 

 /* load new content */     
}

Here is the API from jQuery UI Tabs http://api.jqueryui.com/tabs/ I didn't find a function that can serve my problem.

Thanks!

Susanne92
  • 217
  • 1
  • 6
  • 21

2 Answers2

1

Edit:

var i=0;
$(function () {
  $("#tabs").tabs();
});

$('#button').click(function(){
  i++;
  $("#tabs div:visible").empty(); 
  $("#tabs div:visible").append('<p>new content'+i+'</p>');                        
});

Demo

1

If you want to change content use this:

$('#button').click(function(){
     $("#tabs-1").empty().append("<span>new html or text</span>");
});

Here is a demo. You can combine it with some ajax request for eg. to get completely new content.

webrama.pl
  • 1,870
  • 1
  • 23
  • 36