Split the string based on
tag using jquery

前端 未结 10 849
温柔的废话
温柔的废话 2021-01-17 20:04

How can i split the string containing
tag using jquery. I tried the following code but it get error in console. I am not sure how to split the strin

10条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 20:39

    What if you try:

    jQuery(document).ready(function($)
        {
            var lines = 'this is for testing 
    How are you
    '.split('
    '); each(lines, function() { alert(this); }); });

提交回复
热议问题