можно, но данные должны быть в "скрипте"
<html>
<head>
<title>Related</title>
</head>
<body>
<select id="select">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<div id="related"></div>
</body>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
const select = document.getElementById('select')
const related = document.getElementById('related')
const values = {
1: { title: 'one' },
2: { title: 'two' },
3: { title: 'three' },
}
function foo(id) {
return values[id].title
}
setHTML = (id) => related.innerHTML = foo(id)
select.addEventListener('change', function (e) {
setHTML(e.target.options[e.target.options.selectedIndex].value)
})
setHTML(select.options[select.options.selectedIndex].value)
})
</script>
</html>