JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test case for set/reset attribute issue</title>
</head>
<body>
<select multiple="multiple">
<option id="opt1">Choice 1</option>
<option id="opt2">Choice 2</option>
</select>
</body>
</html>
JavaScript
// Both options should be selected at the end of manipulation
var opt1 = $('#opt1');
var opt2 = $('#opt2');
opt1.prop('selected', true);
opt2.prop('selected', false);
opt2.removeAttr('selected');
opt2.prop('selected', true);