Some JavaScript functions and code snippets useful for Programmers and JS scripts.

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag renders as emphasized text, displaying the text oblique?
<strong> <pre> <em>
<p>Web development courses: <em>CoursesWeb.net</em></p>
Which CSS property defines the space between the element border and its content?
margin padding position
h3 {
  padding: 2px 0.2em;
}
Click on the method which returns the first element that matches a specified group of selectors.
getElementsByName() querySelector() querySelectorAll()
// gets first Div with class="cls", and shows its content
var elm = document.querySelector("div.cls");
alert(elm.innerHTML);
Indicate the PHP variable that contains data from a form sent with method="post".
$_SESSION $_GET $_POST
if(isset($_POST["field"])) {
  echo $_POST["field"];
}
JavaScript Code Snippets

Last accessed pages

  1. JavaScript code and PHP (24801)
  2. Register and show online users and visitors (29010)
  3. Add and Remove HTML elements and Content with jQuery (25871)
  4. PHP getElementById and getElementsByTagName (29611)
  5. Contact page - CoursesWeb (19293)

Popular pages this month

  1. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (1769)
  2. Tabs effect with CSS (1721)
  3. Contact page - CoursesWeb (1718)
  4. Insert, Select and Update NULL value in MySQL (837)
  5. PHP getElementById and getElementsByTagName (519)