Сергей Ракипов,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div{
width: 100px;
height: 100px;
border: 1px solid #0000FF;
}
</style>
</head>
<body>
<div>0</div>
<div>1</div>
<div>2</div>
<script>
const div = document.querySelectorAll('div');
const opt = {backgroundColor : 'teal', padding : '10px', color : '#FFFFFF'};
Object.assign(div[2].style, opt);
</script>
</body>
</html>