Use JQuery to build an anchor

前端 未结 5 1293
抹茶落季
抹茶落季 2020-12-20 11:19

I want to use jquery to build HTML like this:

  • Track Nam
  • 5条回答
    •  轮回少年
      2020-12-20 12:21

      //overwrites the innerHTML of all anchors *selector must be changed to more specific
      $('a').html('Track Name');
      
      //wraps existing text and prepends the new span
      $('a').wrapInner('')
          .prepend('');
      

      http://jsfiddle.net/gaboesquivel/f2dcN/3/

    提交回复
    热议问题