xxxxxxxxxx
// Using jQuery to set display none
$(element).css("display", "none");
xxxxxxxxxx
The correct way to do this is to use show and hide:
$('#id').hide();
$('#id').show();
An alternate way is to use the jQuery css method:
$("#id").css("display", "none");
$("#id").css("display", "block");
xxxxxxxxxx
// Correct way
$('#id').hide();
$('#id').show();
// Alternate way
$("#id").css("display", "none");
$("#id").css("display", "block");
xxxxxxxxxx
$(document).ready(function() {
// Set the display property of an element with id 'myElement' to 'none'
$('#myElement').css('display', 'none');
});
xxxxxxxxxx
$(document).ready(function() {
// Hide the element with the ID 'myElement'
$('#myElement').css('display', 'none');
});