Layers are always visible on web export unless they are a popup or a mouseover layer (where they only show when the trigger object invokes them).

Layers help with keeping page elements separate, but not for hiding from view when exported to HTML.

The hide/show layer and locking button are drawing aids rather than an export state.

You could delete the layer you don't want exported and save that .web or .xar as a separate instance of the project file, then go back to the original .web or .xar when you are ready to include those layers in the next html export.