wie alle bekommen die text
nach <br/>
tag
, wie der Text nach <br> Tag zu bekommen
meine html wie dieses ist
<i class="loc">cherry<br>From Shimla</i>
<i class="loc">Apple<br>from kashmir</i>
<i class="loc">banana<br>From bihar</i>
erwartete Ausgabe: ["From Shimla","from kashmir","From bihar"];
i wie etwas versucht, bin diese
var arr = [];
$('.loc').each(function(){
arr.push($(this).text());
});
console.log(arr);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<i class="loc">cherry<br>From Shimla</i>
<i class="loc">Apple<br>from kashmir</i>
<i class="loc">banana<br>From bihar</i>
dank arbeitet alot perfekt –