Skip to main content

Posts

Showing posts from January, 2019

How to Create a Modal Box using HTML, CSS & JavaScript

Firstly, you need to be familiar with HTML, CSS and JavaScript to understand this tutorial. If you are then move on and if not I'll suggest you get yourself familiarized with those. Now here are what we will be doing: 1. Create the modal structure with  HTML 2. Style the structure with  CSS 3. Show and hide the modal with  JavaScript 1.   Create the modal structure Create the modal container. We'll be doing this with the  div element. Inside the container create a sub-container which will contain our modal content.   Code snippet: <div class = "modal_container"> <div class = "modal_content"> </div> </div> The class names given to both the container and content will be referenced in our CSS style. 2.  Style the structure Now lets give the  .modal_container  the following: a transparent black  background-color   :   rgba(0,0,0,0.5) a  width  a...

JavaScript Data types

Simply put, a data type in simply the type of data. It could be a string (eg. a username), an integer number (eg. population of people) or a floating-point number (eg. a student's GPA) and more. Each data type has a set of operations that can be performed on them. Just as you divide a number by another number (eg. 30/12) but cannot divide a name by a name. An operation is only valid as it is allowed by the data type. JavaScript is a loosely or weakly typed language. This is simply because the data type of a variable or constant in known by its value. The table below shows the data types: JavaScript Data types 1. string 2. number 3. function 4. boolean 5. null 6. undefined

Introduction to JavaScript

JavaScript(JS) is lightweight interpretive high-level programming language. Invented by Brendan Eich , it was first released in December 1995. Today it is the most popular language used on the web (and the world too) 1 . JavaScript should not be confused with Java. The name JavaScript was adopted in order to popularize the language since Java was already known at that time. Initial name: LiveScript Official name: ECMAScript Inventor: Brendan Eich Date released: December, 1995 JavaScript can be used to write browser-centric(client-side) and server-centric(server-side) scripts, that is scripts which run on the browser and on the server respectively. And so JavaScript is both a client-side and server-side programming language. Node.js is a server-side implementation of JS. Some uses of client-side JavaScript To dynamically manipulate elements(structural and presentational elements) on a web page. To c...