Dynamically adding
  • to
      in jquery mobile
  • 前端 未结 5 1880
    太阳男子
    太阳男子 2020-12-02 16:43

    I\'m trying to add list items to unordered lists in jquery mobile, but the formatting doesn\'t seem to be created properly.

    5条回答
    •  盖世英雄少女心
      2020-12-02 17:33

      You will have to add a class to the list tag

      $('
        ').append( $('
      • ').attr('class','ui-li ui-li-static ui-btn-up-c ui-li-last').append('hello')) ;

      JQuery mobile automatically adds a class to the list items, which can be seen if you run your page in firefox and debug it using firebug. Select whatever class has been applied and add it to your dynamically generated li tag.

    提交回复
    热议问题