Finding text node

前端 未结 8 1262
半阙折子戏
半阙折子戏 2021-01-03 08:14

Is there a clever jQuery selector for selecting a text node like this:

one two three
8条回答
  •  执念已碎
    2021-01-03 08:42

    Not without some programming. If your main DIV had an ID or class, you could do this:

    var html = $("#my_div").html();
    var array = html.split("");
    array[1] = "" + array[1] + "";
    html = array[0] + "" + array[1];
    
    $("#my_div").html(html);
    

提交回复
热议问题