jQuery

jQuery – get the last class of an element

In some cases, we need to get the last class of an element so that, we can write our logic based on that. Today, we will see, how we can do the same using jQuery code. The jQuery Code: And here is the full example: Hope, it will help you.

A simple way to change the placeholder text using jQuery

The placeholder is an attribute in HTML that help users to know the expected value of the input field. It is visible to the users until the user enters the value in the input field. In following example, I have used j Query’s attr() method to change the placeholder text and the scenario is, when… Read More »

How to add class to parent div using jQuery

In this blog, I am going to share with you a small how to guide that will be helpful for you if, you are looking for the code to add a class to parent div using jQuery library. Let’s say, you have structured your HTML document as following and you are interested in adding a… Read More »

How to hide element by id in jQuery

jQuery has a lot of methods available that can help you in performing task easily without writing multiple lines of codes in JavaScript. In this blog, I am going to share with you multiple tricks, by using, you can hide element by id in jQuery easily. Lets say, you have a <div> which has assigned… Read More »