Hello!
There is an HTML block where input is hidden using styles, and the label is a button ( http://viralpatel.net/blogs/css-radio-button-checkbox-background/ ):
<input type="radio" name="type" value="20" value="20"> <label for="20">20</label> I need by pressing y input to get the value value="20"
In javascript:
document.addEventListener('click', function(e){ console.log(e.target) }); In the console, two events are displayed by a mouse click, one belongs to <label> , the other <input> . If you write console.log (e.target.value), then the label will be undefined , input = 20.
I do not think that is correct. What is the best way to get a value for input only, without affecting the label (without jQuery)?