Yes it does work, it would have simply shown you an error on that line and all you have to do was to remove the extra parentheses at the end of hidden.
$w.onReady(function () {
});
export function BottoneA_click(event) {
if (!$w("#Error1").hidden) {
$w("#Boxnext").hide()
}
if ($w("#Error1").hidden) {
$w("#Boxnext").show();
}
}
If #Error is showing on the page when the button is clicked, #Boxnet will be hidden.
If both #Error and #Boxnet are set up as hidden on load, then when button is clicked #Boxnet will be shown.