Amir
Amir

Reputation: 6186

JQuery UI Tabs -clear page

I have a set of containers that are loaded in JQuery UI tabs each time I click on a search button. What I want to do is to clear the whole tab before I load anything in that. I tired the following but it didn't work.

$("#tab1").html("");
$("#tab2").html("");

Upvotes: 1

Views: 1297

Answers (1)

Juan Jimenez
Juan Jimenez

Reputation: 5892

This is working for me:

<div id="tabs">
        <ul>
            <li><a style="font-size: small;" href="#tab1">T</a></li>
            <li><a style="font-size: small;" href="#tab2">G</a></li>
        </ul>
        <div align="center" id="tab1">
            <div id='ts'>
                ....</div>
        </div>
</div>
<input id="Button1" type="button" value="button" onclick="ClearTabs()" />




<script >
        $(function () {
            $("#tabs").tabs();
        });
        function ClearTabs() {
            $("#tab1").html("");
            $("#tab2").html("");
        }
</script>

Upvotes: 1

Related Questions