Skip to end of metadata
Go to start of metadata

JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat.

Javascript is usually combined with HTML5 to implement rich UI. Below is useful information:

  • Page:
    Check whether a checkbox is checked in Javascript (Knowledge Base) Checkbox object in HTML has a property checked as boolean - it has true or false, so javascript can check its status easily.
  • Page:
    Input Text readOnly Property in Javascript (Knowledge Base) —  Set a text field to read-only in javascript
  • Page:
    Draggable DIV tag combined with Javascript (Knowledge Base) — For draggable DIV tag, what you need to keep in mind is "position: absolute" in style sheet.
  • Page:
    Drag and drop image in div tag in Javascript/HTML5 (Knowledge Base) — Drag and drop is a very common feature. It is when you "grab" an object and drag it to a different location. In HTML5, drag and drop is part of the standard: Any element can be draggable. The element you should keep in mind is draggable="true" ondragstart="func(event)" for starting drag, and ondrop="drop(event)" ondragover="allowDrop(event)" for accepting dragging.
  • Page:
    HTML / HTML5 (Knowledge Base) HTML5 is a software solution stack that defines the properties and behaviors of web page content by implementing a markup based pattern to it. HTML5 is the fifth and current major version of HTML, and subsumes XHTML.
  • Page:
    Combo box (drop-down list) in HTML (Knowledge Base) — To implement Combo box also known as drop-down list, you should use <select> tag
  • Page:
  • Page:
    Array Length in JavaScript (Knowledge Base) — In JavaScript, <array>.length returns the total number of item.
  • Page:
    Redirect from an HTML page (Knowledge Base) — Page redirection is a situation where you clicked a URL to reach a page A but you were directed to another page B. It happens due to page redirection. To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content is the number of seconds; you want the page to redirect after.
  • Page:
    HTML5 Canvas (Knowledge Base) — The HTML5 <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). However, the <canvas> element has no drawing abilities of its own (it is only a container for graphics) - you must use a script to actually draw the graphics. The getContext() method returns an object that provides methods and properties for drawing on the canvas.
  • Page:
    Adding HTML content dynamically by innerHTML (Knowledge Base) — When you assign ID for HTML entity for <p> tag or <div> tag, we can dynamically update its content. You can find the object by getElementById(), and do the necessary actions into innerHTML. For instance, you can do it like document.getElementById( "element_id").innerHTML = "hello, world!";
  • Page:
    Playback Video in HTML5 (Knowledge Base) — In HTML5, playback video is super easy by <video width="...." height="...." autoplay> tag. You can also set its source by <source src="movie.mp4" type="video/mp4"> tag.
  • Page:
    jQuery (Knowledge Base) — jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
  • Page:
    String to ISO Dates, Date to String in Javascript (Knowledge Base) — If you want to put date information as string like "2020-07-30" to date in javascript, bingo! - it works correctly.
  • Page:
    Check if the variable is object or not (Knowledge Base) typeof <variable name> shows its type in string in JavaScript