<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<script>
function selection1()
{
var x = document.getElementById('male');
//const x = document.getElementById('male');
x.checked = true;
}
function selection2()
{
var x = document.getElementById('male');
//const x = document.getElementById('male');
x.setAttribute('checked', '');
}
function unselect()
{
var x = document.getElementById('male');
//const x = document.getElementById('male');
x.removeAttribute('checked');
}
</script>
</head>
<body>
<input type="radio" id="male" name="gender">Male
<input type="radio" id="female" name="gender">Female
<input type="radio" id="other" name="gender">Other
<input type="submit" onclick="selection2()" value="Male Select">
<input type="submit" onclick="unselect()" value="Unselect">
</body>
</html>
0 Comments