html code for event management code example

Example 1: most used events in javascript

most used events in javascript

Example 2: event in buejs

<template>
	<div>
		<button v-on:click="increment">Increment</button>
		<button @click="decrement">Decrement</button>
		<h4>Counter Count: {{ counter }}</h4>
	</div>
</template>

<script>
	export default {
		name: 'DataEvent',
		data: () => ({
			counter: 0
		}),
		methods: {
			increment() {
				this.counter++
			},
			decrement() {
				this.counter--
			}
		}
	}
</script>

<style scoped>
	button {
		padding: 5px;
		font-size: 20px;
		margin: 10px;
	}
	h4 {
		font-size: 18px;
	}
</style>

Tags:

Html Example