I'm trying, if an "if" condition is true, to set the style of an element to "visibility:hide;".
I've done this:
if (user.privilege = 3) {
$("#persone").css("visibility:hidden;");
}
But when the If condition runs, in the console i get this error:
"Uncaught TypeError: Cannot read properties of null (reading 'style')"
What should i do to solve this?
var html = '<div class= "col-lg-6">'+
'<label class="mt-15">A chi è riferito l\'evento? </label>' +
'<select class="form-control" id="persone" >' +
_this.GetOptionPersone() +
'</select >' +
'</div>' ;