Add and Remove Classes using JavaScript is quite handy. Even it’s better to use a JavaScript framework or a library for such common tasks and I have mentioned the reason behind doing so at the end of article, these JavaScript code to adding and removing classes are worth considerable.
Category » jQuery
Array in JavaScript – push() Method
Array in JavaScript push() method appends the given element or elements in the last of array. It returns the length of the new array.
Syntax is as below:
array.push(item1, item2,.....itemN);
Array in JavaScript – slice() Method
Array in JavaScript has slice() method that is used to extract a section of an array. This method returns a new array.
Syntax is as below:
array.slice( begin [,end] );
Make a HTML, CSS, JS try it yourself editor
Making a try it yourself editor is a very easy and 5 minutes task if you know the concept behind it. Here I’m telling you step by step to create a try it yourself editor like w3 schools that would be able to run your HTML, CSS and javascript code online and display the result in iframe.
Open popup from another popup in jQuery
I had popup working and I wanted to open popup from another popup where a link was placed inside first popup using jQuery. This kind of scenario is quite common.
Most probable example we see are login and register popup boxes where one can toggle to login/register popup box through a link given in currently opened popup.
Array in JavaScript – sort() Method
sort() method for Array in JavaScript is used to sort the elements in that array.
Array in JavaScript – splice() Method
Array in JavaScript has splice() method that changes the elements of an array, adding new elements as well as removing old.
splice() method for Array in JavaScript is powerful method that let you modify an existing array. You can add, remove elements or replace existing elements.
Array in JavaScript – unshift() Method
Array unshift() method adds one or more elements to the beginning of an existing array and returns the new length of the array in Javascript.
Array in javascript
Array is most important keyword used in programming languages. Like other languages, Array is also used in javascript. Array in JavaScript is used to store multiple values in a single variable. Arrays in javascript is as special type of object
update div top position based on its changing height
Few days ago, I have a requirement to update Div top position based on its changing height. I tried to resolve it by using different way