I have the below mark up and scripts. I have a span with rootnode as id and it's sibling is input checkbox.
my requirement is when i click on the span, input check box onchanange handler should call with the input event object.
pleas find the below code snippet as well as i have give codepen url with the example.
HTML
Checkbox Accesibility Need
<div>
<span id="rootnode" role="checkbox" aria-checked="false">
<span>i am bike</span>
</span>
<input tabindex="-1" type="checkbox" onchange="handleChange()" name="vehicle1" value="Bike">
</div>
JAVASCRIPT
document.getElementById("rootnode").addEventListener('click',this.handleclick);
function handleChange(e) {
alert(1)
}
function handleclick(e) {
alert('event fired..');
// how to call onchange handler handleclick with input event object.
}
Example URL : https://codepen.io/anon/pen/ejKqzy?editors=1010
Your help is highly appreciated.
Thank You!!!