inner element click trigger the parent click event

Solutions on MaxInterview for inner element click trigger the parent click event by the best coders in the world

showing results for - "inner element click trigger the parent click event"
Louisa
17 Jun 2019
1You need to use event.stopPropagation()
2
3Inline:
4<input class="form-control" onclick="event.stopPropagation()">
5
6Using a function:
7<input class="form-control" onclick="buttonClicked(event)">
8
9<script>
10function buttonClicked(event){
11	event.stopPropagation();
12    
13	// continue performing button click actions
14}
15</script>