I also use the same method that adds css to HTML elements via jQuery, for me it perfectly cancels the css property, because the browser itself removes the css attributes without a value. If you install a display unit, this may cause some problems to appear in the display unit, which will violate your current HTML structure.
However, if you want this to be correct, you can use the addClass and removeClass methods and create a class
.hideBlock{ display : none; }
JQuery code
$('#testDiv').addClass('hideBlock); //to Hide $('
source share