How to hide something with jquery and css

Asked

Viewed 25 times

-2

I need to hide some things using jquery along with css , I tried using Hide() but it didn’t work... some solution??

my code:

$(document).ready(function(){

$('#ID_USER')hide();//não funcionou...

});
  • One point left: $('#ID_USER').hide();.

2 answers

0

Maybe you missed a point, it should work like this:

$('#ID_USER').hide();
  • I changed it but it didn’t help... But I did as the partner down here spoke , using . css().. Thanks anyway!!

0


Check if you are rescuing the correct element ID, if the element already exists on the page and put a . between element selection and method call hide. From this you can hide the element. The two forms I consider simpler:

Using hide:

$("#ID_USER").hide();

Or by changing the style of your element:

$("#ID_USER").css('display', 'none');

The method css allows you to change the styling of the element and is quite flexible for other types of use as well. I recommend reading more about.

To display the element again, you can use show() or change the style still using the method css:

$("#ID_USER").show();

$("#ID_USER").css('display', 'block');

I hope I’ve helped in some way.

  • thanks friend !! helped a lot !!

Browser other questions tagged

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