JSFiddle - React, Tailwind, and code Playground
by shahrukh007
HTML
<html>
<head>
<body>
<p id = "demo"> </p>
<input type="checkBox" class="student" name="abc" id="std1" value="shahrukh" onchange="myfunction('std1',event)">shahrukh
<input type="checkBox" class="student" id="std2" value="amir" onchange="myfunction('std2',event)" >amir
<input type="checkBox" class="student" id="std3" value="salman" onchange="myfunction('std3',event)" >salman
<button onclick="alert(txt);">
click me
</button>
<script>
var txt = "";
function myfunction(student,e){
var x = $('.student');
console.log(x);
x.each(function(){
console.log(this.checked,this.id,this.className,this.name,this.type)
})
}
</script>
</body>
</head>
</html>