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