Tags
Asked 3 years ago
10 Jun 2021
Views 295
Luigi

Luigi posted

How to get text from multiple elements in Jquery ?


i want to get multiple element 's text by Jquery


<div>
<label class="form-field">Email</label> email@gmail.com
</div>
<div>
<label class="form-field">Username</label> myname
</div>


how to get text from mulitple elements in Jquery

jessica

jessica
answered Jun 10 '21 00:00

use class selector for Jquery like this

$(".form-field").each(function(){
console.log($(this).text())
})
Post Answer