JavaScript Code Snippets

Some JavaScript functions and code snippets useful for JavaScript Programmers and JS scripts.
New JavaScript Code Snippets might be added soon.

  1. Follow the mouse cursor with a DIV inside a Parent
  2. Creating Tabs Effect with JavaScript
  3. jQuery Drag and Drop Rows between two similar Tables
  4. Delete multiple consecutive characters and Split long words
  5. Keep the first Nr IMG tags, Remove all the others
  6. Add Text in Canvas from Input text field, as it is Typed
  7. Clear Canvas Context
  8. Get the Height and Width of web Page and browser Window
  9. Detect when ScrollBar reaches the bottom of the page
  10. Add Tag to Selected Text in textarea with JavaScript
  11. Select the Content of HTML Element
  12. Convert BBCode to HTML and HTML to BBCode
  13. Show and Hide HTML elements
  14. Recursive function to create Multi-Level Menu in JavaScript
  15. Highlight Images on click
  16. Disable button and Enable it after specified time
  17. Get Domain Name and other Data from URL
  18. Get search data from URL address in JavaScript
  19. SHA512 Encrypt hash
  20. SHA256 Encrypt hash
  21. SHA1 Encrypt data
  22. MD5 hash string
  23. Base64 encode decode
  24. Split an alphanumeric string into Array
  25. Delete and Add CSS class
  26. Replace JavaScript variable name from string with its value
  27. Get the value of the selected /checked checkboxes in a form
  28. Get Lower, Higher and Closest Number in JavaScript
  29. Difference between two Dates - Time and Date
  30. JavaScript trim, rtrim and ltrim
  31. JS PHP is_ functions to test data type
  32. array_map and array_search in JS
  33. JavaScript strip_tags and stripslashes
  34. Zodiac Signs JavaScript code