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

HTML
CSS
JavaScript
PHP-MySQL
What attribute makes the input text box to not be modified by the user?
checked="checked" readonly="readonly" disabled="disabled"
<input type="text" value="fixed-value" readonly="readonly" name="a_name" />
What CSS property allows you to create rounded corners in your webpage design?
background-size border-size border-radius
.class {
  border:2px solid blue;
  border-radius:1.2em;
}
What instruction displays a confirmation dialog box to the viewer, who must then click OK or Cancel to proceed?
indexOf() confirm() prompt()
var ques = window.confirm("The result of 0+0 is 0?");
if (ques) alert("Corect");
else alert("Incorrect");
Indicate the PHP function that returns the lowest number of the parameter values.
floor() ceil() min()
$min_nr = min(12, 8, 25, 13);
echo $min_nr;        // 8
JavaScript Code Snippets

Last accessed pages

  1. Ajax-PHP Rating Stars Script (552)
  2. Register and show online users and visitors (497)
  3. Integer and Float value in Select with PDO from string to numeric (119)
  4. PHP MySQL - using MySQLi (343)
  5. Create simple Website with PHP (470)

Top accessed pages

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