How to split a string at the first `/` (slash) and surround part of it in a ``?

前端 未结 7 1741
独厮守ぢ
独厮守ぢ 2020-11-28 01:28

I want to format this date:

23/05/2013
.

First I want to split the string at the first / and have the res

7条回答
  •  [愿得一人]
    2020-11-28 02:04

    You should use html():

    SEE DEMO

    $(document).ready(function(){
        $("#date").html(''+$("#date").text().substring(0, 2) + '
    '+$("#date").text().substring(3)); });

提交回复
热议问题