jQuery each line in textarea

后端 未结 4 1702
别跟我提以往
别跟我提以往 2021-02-20 12:17

html



jquery

4条回答
  •  滥情空心
    2021-02-20 12:39

    I think you can't use the html tags in this manner for this you have to specify and ID for each tag and then access in the jQuery function.

     
    
    $('#btn').click(function(){
        var arrayOfLines = $('#gps').val().split('\n');
        $.each(arrayOfLines, function(index, item) {
            $this = $(this);
            console.log($this);         
        });
    });
    

提交回复
热议问题