How do you select a particular option in a SELECT element in jQuery?
how to create ajax request without using serialize
If you have let's say an unordered list and it is populated with multiple items and you need to highligh the clicked item and if clicked again remove the highlight. A very good and interresting way to do this is to make use of the buble behavoir for events and add event listener only for the parent container element, and then use the event.target to get to the clicked element itself, which is the list item in our example.
Here is a snippet for a function to create a loader or a loading div to be used with ajax request and then can also hide it.
In this class, we will have a helper class that will allow us to do the following: clear event listener from an element. move an element to another location ..etc
If you need to use the prototype to add new general methods to any general protoype or construct functions such as Object, Array, String .. etc, here are few examples
In order to convert an object into an array, this is easy using the Object.values() method. On the other hand if you want to convert an object into a string, any Object can be converted to a string using the JSON.stringify() method.