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 in JavaScript
  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. Convert BBCode to HTML and HTML to BBCode with JavaScript
  12. Select the Content of HTML Element
  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 in JavaScript
  20. SHA256 Encrypt hash in JavaScript
  21. SHA1 Encrypt data in JavaScript
  22. MD5 hash string in JavaScript
  23. JavaScript base64 encode decode
  24. Split an alphanumeric string into Array in JavaScript
  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. JavaScript PHP is_ functions to test data type
  32. array_map and array_search in JavaScript
  33. JavaScript strip_tags and stripslashes
  34. Zodiac Signs JavaScript code

Daily Test with Code Example

What attribute makes a radio button or checkbox input selected?
checked="checked" selected="selected" disabled="disabled"
<input type="checkbox" name="a_name" value="value" checked="checked" />
What CSS value scales the background image to the largest size contained within the element?
repeat-x contain linear-gradient
#id {
What operator is used to determine the rest of the division of two numbers?
% * /
var rest8_7 = 8 % 7;
Indicate the PHP function that rounds a number up to the next highest integer.
floor() ceil() abs()
$nr = ceil(3.5);
echo $nr;        // 4
JavaScript Code Snippets

Last accessed pages

  1. Get Attribute (ID, Class, Name, Title, Src) with jQuery (3138)
  2. Insert, Select and Update NULL value in MySQL (745)
  3. Read Excel file data in PHP - PhpExcelReader (1976)
  4. Upload Script for Gallery of Images and Audio files (664)
  5. Buttons, Checkbox, Radio, Select, Option objects (148)

Top accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (3553)
  2. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (3411)
  3. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (3341)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (3138)
  5. PHP Chat Script (2829)