Split the string based on
tag using jquery

前端 未结 10 845
温柔的废话
温柔的废话 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:51

    Try this

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

    Demo

提交回复
热议问题