J V
J V

Reputation: 11936

jQueryui reset widget to html

Is it possible to remove jQueryui from elements in javascript?

IE: I make an accordion, but want a button to revert the accordion to normal html when clicked.

Upvotes: 0

Views: 528

Answers (1)

RustyToms
RustyToms

Reputation: 7810

You can just call destroy. Here is the documentation: http://api.jqueryui.com/accordion/#method-destroy

destroy()
Removes the accordion functionality completely. This will return the element back to its pre-init state. This method does not accept any arguments. Code examples:

$( ".selector" ).accordion( "destroy" );

So in your button, you can add onClick='$( ".selector" ).accordion( "destroy" );', or use an event handler that is activated on the button click.

Upvotes: 2

Related Questions