Jquery command does not work

Asked

Viewed 40 times

-1

On my html page, I have the following elements:

<div class="alert alert-danger" role="alert" style="visibility:hidden" id="erro">CNS inválido!</div>
<input type="text" class="form-control" name="cns" maxlength="15" required onblur="erro();" />
<script src="paciente.js"></script>

As the page is very large, I posted only the main elements and that has to do with the problem.

In the patient.js file I have only:

function erro(){
  $("#erro").css('visibitily', 'visible');
};

The js file is loaded normally, but has no errors and does not work.

  • 1

    The word visibility is misspelled.

1 answer

1


The word visibility is misspelled, the correct would be:

function erro(){
  $("#erro").css('visibility', 'visible');
};

Browser other questions tagged

You are not signed in. Login or sign up in order to post.