• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Archives for jQuery

jQuery

jQuery – Add class / remove class

Filed Under: JavaScript Tagged With: jQuery

How to make the font-weight bold of the first word with JS?

View Demo

1) Add the class firstWord to your heading or paragraph

2) You can select the first word of the text by adding a span class to it with jQuery

Filed Under: JavaScript Tagged With: jQuery

jQuery – Add class only to the selected item

$(document).ready(function () {
   $('button').click(function () {
     $("button").removeClass("selected");
     $(this).addClass("selected");
   });
 });

Filed Under: JavaScript Tagged With: jQuery

jQuery – Do something if checkbox is checked

Filed Under: JavaScript Tagged With: jQuery

jQuery Changing Element Styles and Classes

Filed Under: JavaScript Tagged With: jQuery

jQuery fadeOut on scroll

jQuery(document).ready(function(){
   jQuery(window).scroll(function(){
         if(jQuery(this).scrollTop() > 600){
             jQuery('#').fadeOut();
         }
         else{
             jQuery('#').fadeIn();
         }
     });
 });

Filed Under: JavaScript Tagged With: jQuery

Add class with jQuery when scrolling

jQuery(window).scroll(function () {
       if (jQuery(document).scrollTop() > 1 ) {
         jQuery('.cube-desktop').addClass('show');
       } else {
         jQuery('.cube-desktop').removeClass('show');
       }
 });    

Filed Under: JavaScript Tagged With: jQuery

Add class only to clicked element with jQuery

jQuery(document).on('click', function() {
      jQuery('.collapse').removeClass("show");
  });
  jQuery(".collapse").click(function(event) {
      // remove classes from all
      jQuery('.show').removeClass('show');
  // add class to the one we clicked jQuery('.collapse', this).addBack(this).addClass("show"); event.stopPropagation();
  });     

Filed Under: JavaScript Tagged With: jQuery

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved