I have a div with this class :
.news{
width:710px;
float:left;
border-bottom:1px #000000 solid;
font-weight:bold;
display:none;
}
And I'd like with some jQuery methods remove that display:none; (so the div will showed) and than add it again (so the div will shadow).
How can I do it? Cheers
jQuery is a lightweight, "write less, do more", JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website. jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.
The main difference among the three is that JavaScript is client-side, i.e., in the browser scripting language, whereas jQuery is a library (or framework) built with JavaScript.
6 Reasons Why We Still Use jQuery in 2021. jQuery has been around for over 10 years, which is a long time for a code library. It's still one of the most popular JavaScript libraries in web development. We love jQuery here at Atypic and still utilize it in our projects.
Though JavaScript is the basic language from which jQuery has evolved, jQuery makes event handling, DOM manipulation, Ajax calls much easier than JavaScript. jQuery also allows us to add animated effects on our web page which takes a lot of pain and lines of code with JavaScript.
To hide the div
$('.news').hide();
or
$('.news').css('display','none');
and to show the div
:
$('.news').show();
or
$('.news').css('display','block');
jQuery provides you with:
$(".news").hide();
$(".news").show();
You can then easily show and hide the element(s).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With