• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details

Return all elements in an array except for the first one

Return all elements in an array except for the first one

Return Array.prototype.slice(1) if Array.prototype.length is more than 1, otherwise, return the whole array.

Miscellaneous

JavaScript Objects Explained

JavaScript objects are variables that contain multiple data values. The values within a JS object are known as properties. Objects use keys to name values, much like how is done with variables.

Basics

Paste an image from the clipboard

Paste an image from the clipboard

Here’s how to paste an image from your computer’s clipboard using JavaScript.

Image Effects

Highlight an element when dragging a file over it

Highlight an element when dragging a file over it

We will highlight the element when user drags a file over it. For example, the element will have a dashed border which can be simulated by a CSS class.

Miscellaneous

Get the computed style of an element

Get the computed style of an element

Get the actual computed style of an element. This factors in browser default stylesheets as well as external styles you’ve specified.

CSS

Remove Duplicates From an Array

Remove Duplicates From an Array

In JavaScript, Set is a collection that lets you store only unique values. This means any duplicated values are removed.

Miscellaneous

Return the current URL

Return the current URL

Use Window.location.href to get the URL of the current page.

Page Details

JavaScript Arrays Explained

JavaScript Arrays Explained

Arrays are container-like values that can hold other values. The values inside an array are called elements.

Basics

Get the direction of the text selection

Get the direction of the text selection

This function returns forward if user selected text from the left to right. It returns backward in the other case.

Text Effects

Get and set inline styles for an element

Get and set inline styles for an element

Get a style, and then if this style is not set as an inline style directly on the element, it returns an empty string.

CSS

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 17
  • Go to page 18
  • Go to page 19
  • Go to page 20
  • Go to page 21
  • Interim pages omitted …
  • Go to page 36
  • Go to Next Page »

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers