jQuery UI without HTML

后端 未结 6 1110
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 08:48

Is there a project (open source) that takes the widgets and plugins for jQuery UI but allows us to use them without setting up any HTML?

Kinda like Ext-js and Sprout

6条回答
  •  眼角桃花
    2020-12-25 09:46

    As "Mr. Shiny and New" pointed out the following code would work:

    $('body').append($('

    However the style you are looking for can be accieved by using the appendTo() function:

    $('')
        .button({
            label: "Hello world!",
        }).click(function () {
            //doSomething
    
        }).appendTo('#test');
    

    Furthermore the code above returns the "button" object which allows you to assign the object to a variable for future reuse:

    // set up the button
    var a = $('

提交回复
热议问题