For useability reasons, I want the open function to be called right after the save button is finished. Using open(); at the end of the function doesn’t work. What’s the correct syntax for calling another function when it starts with var? (This is called an anonymous function, right?)
You haven’t given us enough information to answer your question.
<button id="open">Open</button>
<button id="save">Save</button>
<script>
var open = function() {
console.log('do open stuff')
}
var save = function() {
console.log('do save stuff')
open()
}
document.getElementById('open').addEventListener('click', open)
document.getElementById('save').addEventListener('click', save)
</script>