This one works in JavaScript precisely because JavaScript is so slipshod about types; unfortunately, the DOM API sometimes doesn't quite make sense when you look at it more carefully.
The problem is basically that querySelector() officially returns an Element, but what you need is an HTMLElement. I don't know of an elegant solution to this one yet (although I haven't been paying close attention to this question), but I believe this tweak should work:
dom.document.querySelector("#element").asInstanceOf[HTMLElement].style.display = "block";
Basically, the asInstanceOf here says, "yes, I know that the API officially just says that this is an Element, but *I* know that it's actually an HTMLElement, so take my word for it". One of these days, we might figure out a more elegant approach...