• 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
Home / Archives for Miscellaneous

Miscellaneous

Check if the given argument is a string

Check if the given argument is a string

Use typeof to check if a value is classified as a string primitive.

Miscellaneous

Detect Internet Explorer browser

Detect Internet Explorer browser

Check if the current browser is Internet Explorer (IE).

Miscellaneous

Check if the given number falls within the given range

Check if the given number falls within the given range

Use arithmetic comparison to check if the given number is in the specified range.

Miscellaneous

Get all siblings of an element

Get all siblings of an element

A simplified approach using some ES6 methods.

Miscellaneous

Check if two arrays or objects are equal

Check if two arrays or objects are equal

A robust way to compare two arrays (or objects) and check if they’re equal to each other.

Miscellaneous

Prevent the default action of an event

Prevent the default action of an event

Use the preventDefault() method. This method works with inline attribute.

Miscellaneous

Get Siblings of an Element

Get Siblings of an Element

This snippet gets the next sibling and previous sibling of an element, using the element.nextSibling and element. previousSibling properties.

Miscellaneous

Get size of the selected file

Get size of the selected file

This snippet can be used to validate a file’s size and display it, for instance when a file is being submitted for upload.

Miscellaneous

Resize an iframe to fit its content

Resize an iframe to fit its content

This snippet gets the height of an iframe’s content and then sets the height of the iframe to match.

Miscellaneous

Xmas Tree Generator

This script makes a random sized Christmas tree with random lights.

Miscellaneous

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 12
  • Go to page 13
  • Go to page 14
  • Go to page 15
  • Go to Next Page »

Primary Sidebar

FREE UPDATES!

Get the latest updates in your inbox for FREE!

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2023 JavaScriptSource.com

  • About
  • Privacy Policy
  • Submit
  • FAQ
  • Jobs For Developers
  • Contact Us