I'm using javascript to access previous element's attribute value.
My HTML :
<form>
<div>
<label for="name">Name :</label>
<input type="text" name="name">
</div>
<div>
<label for="email">E-Mail :</label>
<input type="email" name="email">
</div>
</form>
I use loop to read all input elements in my form.
But, i want to read the label's HTML.
ex.
Input Element : 'email'
Label : 'E-Mail'
Also i want Javascript Solution ONLY !
//////// I'm not using jQuery ! ///////